nixos-config/shared/vim.nix

61 lines
1.9 KiB
Nix
Raw Normal View History

2023-05-19 11:42:43 +02:00
{ pkgs, ... }:
2022-12-19 19:30:32 +01:00
{
2023-05-18 12:49:06 +02:00
environment.variables = { EDITOR = "hx"; }; # we set helix in here to have it shared
2022-12-19 19:30:32 +01:00
environment.systemPackages = with pkgs; [
((vim_configurable.override { }).customize {
name = "vim";
vimrcConfig.packages.myplugins = with pkgs.vimPlugins; {
2022-12-27 18:21:33 +01:00
start = [ vim-nix ];
2022-12-19 19:30:32 +01:00
opt = [ ];
};
vimrcConfig.customRC = ''
" basic commands bound to uppercase key
command Q q
command W w
command Wq wq
command WQ wq
set number relativenumber
set tabstop=4
set shiftwidth=4
set smartcase
set colorcolumn=120
set nowrap
syntax on
highlight ColorColumn ctermbg=darkgray
" set space as leader
nnoremap <SPACE> <Nop>
let mapleader = " "
" beautify indents
:set list lcs=tab:\|\
"remove ex-mode shortcut
nmap Q <Nop>
" quickfixlist binds
nnoremap <C-j> :cnext<CR>
nnoremap <C-k> :cprev<CR>
" locallist binds
nnoremap <C-l> :lnext<CR>
nnoremap <C-h> :lprev<CR>
" split keybinds
nnoremap <leader>s :sp<CR>
nnoremap <leader>v :vs<CR>
nnoremap <leader>h <C-w>h
nnoremap <leader>j <C-w>j
nnoremap <leader>k <C-w>k
nnoremap <leader>l <C-w>l
'';
}
)
];
}