-
Notifications
You must be signed in to change notification settings - Fork 0
/
vim.nix
48 lines (43 loc) · 1.13 KB
/
vim.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
{ config, pkgs, ... }:
{
programs = {
vim = {
enable = true;
plugins = with pkgs.vimPlugins; [
fzf-vim
# tabular
vim-unimpaired
];
settings = {
expandtab = true;
shiftwidth = 4;
tabstop = 4;
};
extraConfig = ''
" Key mappings
" Buffer navigation
nnoremap gb :buffers<cr>:buffer<space>
nnoremap gd :bd<cr>
nnoremap gn :bn<cr>
nnoremap gp :bp<cr>
" Window splits
nmap <leader>sw<left> :topleft vnew<CR>
nmap <leader>sw<right> :botright vnew<CR>
nmap <leader>sw<up> :topleft new<CR>
nmap <leader>sw<down> :botright new<CR>
" Buffer splits
nmap <leader>s<left> :leftabove vnew<CR>
nmap <leader>s<right> :rightbelow vnew<CR>
nmap <leader>s<up> :leftabove new<CR>
nmap <leader>s<down> :rightbelow new<CR>
" Fzf.vim
nnoremap <silent> <C-f> :Files<CR>
nnoremap <silent> <Leader>f :Rg<CR>
" Settings
color evening
set background=dark
set softtabstop=4
'';
};
};
}