Skip to content

Commit

Permalink
add vimrc
Browse files Browse the repository at this point in the history
  • Loading branch information
otosky committed Mar 31, 2024
1 parent a483ff2 commit ac7fc58
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions home/users/olivertosky/home.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,49 @@
};
};
};

programs.vim = {
enable = true;
settings = {
number = true;
relativenumber = true;
expandtab = true;
tabstop = 2;
shiftwidth = 2;
};
extraConfig = ''
" settings
syntax on
set autoindent
set smarttab
set backspace=indent,eol,start
set hlsearch
set incsearch
set colorcolumn=100
set nowrap
set noswapfile
set laststatus=2
set scrolloff=8
" remaps
let mapleader = " "
inoremap <C-L> <Esc>
nnoremap <C-n> :nohl <CR>
nnoremap Y y$
nnoremap L $
nnoremap H ^
nnoremap dH d^
tnoremap <Esc> <C-\><C-n>
" move text
vnoremap J :m '>+1<CR>gv=gv
vnoremap K :m '<-2<CR>gv=gv
inoremap <C-j> <esc>:m .+1<CR>==
inoremap <C-k> <esc>:m .-2<CR>==
nnoremap <leader>k :m .-2<CR>==
nnoremap <leader>j :m .+1<CR>==
xnoremap <leader>p "_dP
'';
};
}

0 comments on commit ac7fc58

Please sign in to comment.