summaryrefslogtreecommitdiff
path: root/config/vim
diff options
context:
space:
mode:
authorSüleyman Fərəcli <suleyman@farajli.net>2025-06-20 17:22:54 +0400
committerGitHub <noreply@github.com>2025-06-20 17:22:54 +0400
commiteb312b971b85c117e02799d72d6dfdcc15c478ed (patch)
tree210d516c35c370cb851c59c0b0d177128e109552 /config/vim
parent4d14ace3c5180ec0827408c1222cb35fe27cf484 (diff)
parentf2ca88c01f88fe3234b196202cd86b19cd9b72bb (diff)
Merge pull request #11 from sfarajli/dev
Dev
Diffstat (limited to 'config/vim')
-rw-r--r--config/vim/vimrc52
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>