diff --git a/config/nvim/init.vim b/config/nvim/init.vim new file mode 100644 index 0000000..a03ec52 --- /dev/null +++ b/config/nvim/init.vim @@ -0,0 +1,143 @@ +" .vimrc + +" only vim and not vi +set nocompatible +" disable autocmd +set secure +" use utf8 only +set encoding=utf8 + +" file/directory matching +set wildmode=list:longest,full +" ignore case when completing +if exists('+wildignorecase') + set wildignorecase +endif +" ignorelist +set wildignore=*.o,*.d,*.so,*.class,*.aux,*.log,*.out,*.toc,*.pdf,*.pyc + +" show completion menu even with only one match +if exists('+completeopt') + set completeopt+=menuone +endif + +" increase command history +set history=1000 +" increase count of possible undos +set undolevels=1000 + +" encrypt buffers when saved to files +if exists('+cryptmethod') + set cryptmethod=blowfish +endif + +" enable fast terminal for tmux but not for ssh connection +if &term =~# '^screen' && !exists('SSH_CONNECTION') + set ttyfast +endif + +" enable automatic file detection, plugin and indention support +if has('autocmd') + filetype off "for pathogen + filetype plugin indent on +endif + +" use utf8 encoding for all files and recognize latin1 +set fileencodings=utf-8,latin1 + +" use unix line-endings and recognize dos endings +set fileformats=unix,dos + +" tabs +set tabstop=4 +set shiftwidth=4 +set autoindent +set smartindent +set smarttab + +" allow backspacing over autoindent and line breaks +set backspace=indent,eol,start + +" already display matches while searching +set incsearch +" only check for case if the searched word contains a capital +set ignorecase +set smartcase +" highlight all matches. use to remove the highlights +set hlsearch + +" syntax folding +if has('folding') + set foldmethod=syntax + " only use folding when there is enough space +" if &columns > 80 +" set foldcolumn=2 +" endif + set foldlevel=99 + + " dont open fold for block movements + set foldopen-=block +endif + +" allow buffers with changes to be hidden +set hidden + +" correct splitting +if has('vertsplit') + set splitright + set splitbelow +endif + +" Visual +" set text color for dark terminal background +set background=dark + +" activate syntax highlighting +if has('syntax') + syntax enable +endif + +" set colorscheme +colorscheme ron + +" display line at which the current is positioned +if exists('+cursorline') + set cursorline + " remove line and make the line bold instead + highlight CursorLine term=bold cterm=bold + highlight CursorLineNR term=bold cterm=bold ctermbg=darkgrey +endif + +" display box from column 81 to 100 +let &colorcolumn=join(range(81, 100), ",") +highlight ColorColumn ctermbg=235 guibg=#2d2d2d + +" display line numbers +set number + +" show currently typed command +set showcmd + +" define characters to display when using 'set list' +set listchars=tab:→\ ,trail:∙,eol:¬,extends:❯,precedes:❮,nbsp:␣ + +" Disable arrow keys +"map +"map +"map +"map + +"map! +"map! +"map! +"map! + +" allow easier pane switching +nnoremap +nnoremap +nnoremap +nnoremap + +" Misc +set mouse=n +noremap m mmHmt:%s///ge'tzt'm diff --git a/setup.sh b/setup.sh index 78c8868..2aad4a9 100755 --- a/setup.sh +++ b/setup.sh @@ -44,11 +44,18 @@ link() link pam_environment ~/.pam_environment # application-specific config +if installed nvim || installed vim; then + echo "Setting up nvim:" + + mkdir -p ~/.config + link config/nvim ~/.config/nvim + + echo +fi if installed vim; then echo "Setting up vim:" link vimrc ~/.vimrc - #link vim ~/.vim echo fi diff --git a/vimrc b/vimrc index a03ec52..d2d7526 100644 --- a/vimrc +++ b/vimrc @@ -1,143 +1,4 @@ -" .vimrc - -" only vim and not vi -set nocompatible -" disable autocmd -set secure -" use utf8 only -set encoding=utf8 - -" file/directory matching -set wildmode=list:longest,full -" ignore case when completing -if exists('+wildignorecase') - set wildignorecase -endif -" ignorelist -set wildignore=*.o,*.d,*.so,*.class,*.aux,*.log,*.out,*.toc,*.pdf,*.pyc - -" show completion menu even with only one match -if exists('+completeopt') - set completeopt+=menuone -endif - -" increase command history -set history=1000 -" increase count of possible undos -set undolevels=1000 - -" encrypt buffers when saved to files -if exists('+cryptmethod') - set cryptmethod=blowfish -endif - -" enable fast terminal for tmux but not for ssh connection -if &term =~# '^screen' && !exists('SSH_CONNECTION') - set ttyfast -endif - -" enable automatic file detection, plugin and indention support -if has('autocmd') - filetype off "for pathogen - filetype plugin indent on -endif - -" use utf8 encoding for all files and recognize latin1 -set fileencodings=utf-8,latin1 - -" use unix line-endings and recognize dos endings -set fileformats=unix,dos - -" tabs -set tabstop=4 -set shiftwidth=4 -set autoindent -set smartindent -set smarttab - -" allow backspacing over autoindent and line breaks -set backspace=indent,eol,start - -" already display matches while searching -set incsearch -" only check for case if the searched word contains a capital -set ignorecase -set smartcase -" highlight all matches. use to remove the highlights -set hlsearch - -" syntax folding -if has('folding') - set foldmethod=syntax - " only use folding when there is enough space -" if &columns > 80 -" set foldcolumn=2 -" endif - set foldlevel=99 - - " dont open fold for block movements - set foldopen-=block -endif - -" allow buffers with changes to be hidden -set hidden - -" correct splitting -if has('vertsplit') - set splitright - set splitbelow -endif - -" Visual -" set text color for dark terminal background -set background=dark - -" activate syntax highlighting -if has('syntax') - syntax enable -endif - -" set colorscheme -colorscheme ron - -" display line at which the current is positioned -if exists('+cursorline') - set cursorline - " remove line and make the line bold instead - highlight CursorLine term=bold cterm=bold - highlight CursorLineNR term=bold cterm=bold ctermbg=darkgrey -endif - -" display box from column 81 to 100 -let &colorcolumn=join(range(81, 100), ",") -highlight ColorColumn ctermbg=235 guibg=#2d2d2d - -" display line numbers -set number - -" show currently typed command -set showcmd - -" define characters to display when using 'set list' -set listchars=tab:→\ ,trail:∙,eol:¬,extends:❯,precedes:❮,nbsp:␣ - -" Disable arrow keys -"map -"map -"map -"map - -"map! -"map! -"map! -"map! - -" allow easier pane switching -nnoremap -nnoremap -nnoremap -nnoremap - -" Misc -set mouse=n -noremap m mmHmt:%s///ge'tzt'm +" use existing nvim configuration for vim +set runtimepath^=~/.config/nvim runtimepath+=~/.config/nvim/after +let &packpath = &runtimepath +source ~/.config/nvim/init.vim