-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvim.nix
More file actions
62 lines (50 loc) · 1.47 KB
/
Copy pathvim.nix
File metadata and controls
62 lines (50 loc) · 1.47 KB
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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{ pkgs, ... }:
{
programs.vim = {
enable = true;
defaultEditor = true;
settings = {
number = true;
tabstop = 2;
shiftwidth = 2;
copyindent = true;
expandtab = true;
};
plugins = with pkgs.vimPlugins; [
indentLine
lightline-vim # status line
vim-commentary # gcc to comment line, or gc + motion
vim-cool # disable search highlight after search
vim-signify # git diff on the left
vim-surround # motion + s + char, i.e. cs( = change surrounding to (
vim-peekaboo # show contents of registers when pressing "
];
extraConfig = ''
set autoindent
set backupcopy=yes
set noshiftround
set showcmd
set softtabstop=2
syntax on
nnoremap <Esc> :noh<CR>
" hide lineno for mouse selection during visual mode
autocmd ModeChanged *:[vV\x16]* set nonumber
autocmd ModeChanged [vV\x16]*:* set number
let g:lightline = {
\ 'colorscheme': 'one',
\ }
let g:indentLine_char = '¦'
" show git diff relative to head (dont ignore staged changes)
let g:gitgutter_diff_base = 'HEAD'
"remove indent line and signify in visual mode
augroup IndentLineVisualToggle
autocmd!
autocmd ModeChanged *:[vV\x16]* IndentLinesDisable | SignifyDisable
autocmd ModeChanged [vV\x16]*:* IndentLinesEnable | SignifyEnable
augroup END
'';
};
programs.fish.shellAbbrs = {
v = "vim";
};
}