diff options
Diffstat (limited to 'config/vim/vimrc')
-rw-r--r-- | config/vim/vimrc | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/config/vim/vimrc b/config/vim/vimrc index 7c66eef..a7d1c0c 100644 --- a/config/vim/vimrc +++ b/config/vim/vimrc @@ -1,15 +1,16 @@ -" Suleyman's minimal vim config for servers -" at https://git.farajli.net/slcf - let mapleader = " " +set background=dark +set clipboard=unnamedplus " Use system clipboard +" set list " Show spaces, tabs, etc. set number -set scrolloff=5 " Smooth scroll -set clipboard=unnamedplus " Use system clipboard -set shortmess+=I " Deactivate intro text -set fillchars=eob:\ " Remove "~" for empty lines (`eob:\` must end with a trailing space) -:set nowrap " Disable wrapping -autocmd BufwritePost * %s/\s\+$//e " Remove useless trailing spaces when saving -autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o " Disable autocomments +set relativenumber +set shortmess+=I " Deactivate intro text +set nowrap " Disable wrapping +set fillchars=eob:\ " Remove "~" for empty lines (`eob:\` must end with a trailing space) + +autocmd BufwritePost * %s/\s\+$//e " Remove trailing spaces when saving +" Disable autocomments +autocmd FileType * setlocal formatoptions-=c formatoptions-=r formatoptions-=o " Different cursor shapes for insert and normal modes let &t_SI = "\e[6 q" @@ -18,19 +19,26 @@ set ttimeout set ttimeoutlen=1 set ttyfast -" Normal mode maps -map <leader><leader> :w!<CR> -map <leader>q :wqa!<CR> -map <C-t> :tabnew<CR> -map <C-w> :tabclose!<CR> -map J :tabn <CR> -map K :tabp <CR> +" Tabs +nnoremap <silent> <C-t> :tabnew<CR> +nnoremap <silent> J :tabn<CR> +nnoremap <silent> K :tabp<CR> -" Insert mode maps +" Windows +nnoremap <silent> <C-Down> :split<CR> +nnoremap <silent> <C-Right> :vsplit<CR> +nnoremap <C-h> <C-w>h +nnoremap <C-j> <C-w>j +nnoremap <C-k> <C-w>k +nnoremap <C-l> <C-w>l + +" Imitate normal mode in insert mode inoremap <C-h> <Left> +inoremap <C-j> <Down> +inoremap <C-k> <Up> inoremap <C-l> <Right> -inoremap <C-j> <C-o>gj -inoremap <C-k> <C-o>gk -inoremap <C-o> <C-o>o +inoremap <C-Space> <Esc> -set background=dark +" Other +nnoremap <silent> <leader><leader> :w!<CR> +nnoremap <silent> <leader>q :wqa!<CR> |