config: nvim: rework basic configuration
This commit is contained in:
parent
ef82f3b11f
commit
846c204094
1 changed files with 40 additions and 12 deletions
|
|
@ -1,6 +1,4 @@
|
|||
" .vimrc
|
||||
|
||||
" only vim and not vi
|
||||
" drop vi-compatibility
|
||||
set nocompatible
|
||||
" disable autocmd
|
||||
set secure
|
||||
|
|
@ -66,6 +64,9 @@ set smartcase
|
|||
" highlight all matches. use <C-L> to remove the highlights
|
||||
set hlsearch
|
||||
|
||||
" treat hyphenated words as a single word
|
||||
set iskeyword+=-
|
||||
|
||||
" syntax folding
|
||||
if has('folding')
|
||||
set foldmethod=syntax
|
||||
|
|
@ -115,29 +116,56 @@ highlight ColorColumn ctermbg=235 guibg=#2d2d2d
|
|||
" display line numbers
|
||||
set number
|
||||
|
||||
" show cursor position all the time
|
||||
set ruler
|
||||
|
||||
" show tabs all the time
|
||||
set showtabline=2
|
||||
|
||||
" 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 <Right> <Nop>
|
||||
"map <Left> <Nop>
|
||||
"map <Up> <Nop>
|
||||
"map <Down> <Nop>
|
||||
" increase completion performance and reduce time until timeout
|
||||
set updatetime=300
|
||||
set timeoutlen=500
|
||||
|
||||
"map! <Right> <Nop>
|
||||
"map! <Left> <Nop>
|
||||
"map! <Up> <Nop>
|
||||
"map! <Down> <Nop>
|
||||
" copy paste between vim and everything else
|
||||
" TODO: check whether the 'plus' suffix works with plain vim
|
||||
set clipboard=unnamedplus
|
||||
|
||||
" Keybindings
|
||||
" allow easier pane switching
|
||||
nnoremap <C-J> <C-W><C-J>
|
||||
nnoremap <C-K> <C-W><C-K>
|
||||
nnoremap <C-L> <C-W><C-L>
|
||||
nnoremap <C-H> <C-W><C-H>
|
||||
|
||||
" allow easier pane resizing
|
||||
nnoremap <M-J> :resize -2<CR>
|
||||
nnoremap <M-K> :resize +2<CR>
|
||||
nnoremap <M-L> :vertical resize -2<CR>
|
||||
nnoremap <M-H> :vertical resize +2<CR>
|
||||
|
||||
" use TAB to switch to next buffers
|
||||
nnoremap <TAB> :bnext<CR>
|
||||
" use Shift-TAB to switch to previous buffers
|
||||
nnoremap <S-TAB> :bprevious<CR>
|
||||
|
||||
" use TAB for skipping through completion options
|
||||
inoremap <expr><TAB> pumvisible() ? "\<C-n>" : "\<TAB>"
|
||||
inoremap <expr><S-TAB> pumvisible() ? "\<C-p>" : "\<TAB>"
|
||||
|
||||
" Misc
|
||||
set mouse=n
|
||||
|
||||
" remove windows ^M when the encoding gets messed up
|
||||
noremap <Leader>m mmHmt:%s/<C-V><cr>//ge<cr>'tzt'm
|
||||
|
||||
" autoreload vimrc when writing init.vim
|
||||
au! BufWritePost $MYVIMRC source %
|
||||
|
||||
" add convenience command for force-saving read-only files
|
||||
cmap w!! w !sudo tee %
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue