-
Notifications
You must be signed in to change notification settings - Fork 1
/
vim.nix.old
104 lines (97 loc) · 3.01 KB
/
vim.nix.old
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
pkgs : {
allowUnfree = true;
packageOverrides = pkgs : with pkgs; rec {
myVimConfig = vim_configurable.customize {
name = "vim";
vimrcConfig.customRC = ''
syntax on
filetype on
set expandtab
set bs=2
set tabstop=2
set shiftwidth=2
set autoindent
set smartindent
set smartcase
set ignorecase
set modeline
set nocompatible
set encoding=utf-8
set hlsearch
set history=700
set t_Co=256
set tabpagemax=1000
set ruler
set number
set nojoinspaces
set shiftround
" linebreak on 500 characters
set lbr
set tw=500
" Visual mode pressing * or # searches for the current selection
" Super useful! From an idea by Michael Naumann
" vnoremap <silent> * :call VisualSelection('f')<CR>
" vnoremap <silent> # :call VisualSelection('b')<CR>
let mapleader = ","
" Disable highlight when <leader><cr> is pressed
" map <silent> <leader><cr> :noh<cr>
" Smart way to move between windows
" map <C-j> <C-W>j
" map <C-k> <C-W>k
" map <C-h> <C-W>h
" map <C-l> <C-W>l
" I accidentally hit F1 all the time
" imap <F1> <Esc>
" nice try, Ex mode
" map Q <Nop>
" who uses semicolon anyway?
" map ; :
" ==== custom macros ====
" Delete a function call. example: floor(int(var))
" press when your cursor is ^ results in:
" floor(var)
" map <C-H> ebdw%x<C-O>x
" Insert a timestamp
" nmap <F3> a<C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR><Esc>
" imap <F3> <C-R>=strftime("%Y-%m-%d %a %I:%M %p")<CR>
" Toggle paste mode on and off
" map <leader>v :setlocal paste!<cr>
" run ctags in current directory
filetype plugin on
" map <C-F12> :!ctags -R -I --c++-kinds=+p --fields=+iaS --extra=+q .<CR>
" Tagbar shortcut
nmap <F8> :TagbarToggle<CR>
" CtrlP File finder
nmap <Leader>t :CtrlP<CR>
let g:syntastic_cpp_compiler = 'clang++'
let g:syntastic_cpp_compiler_options = ' -std=c++11'
let g:syntastic_c_include_dirs = [ 'src', 'build' ]
let g:syntastic_cpp_include_dirs = [ 'src', 'build' ]
let g:ycm_autoclose_preview_window_after_completion = 1
'';
vimrcConfig.vam.knownPlugins = pkgs.vimPlugins;
vimrcConfig.vam.pluginDictionaries = [
{ names = [
"Syntastic"
"Tagbar"
"ctrlp"
"github:LnL7/vim-nix"
"github:elmcast/elm-vim"
"vim-addon-nix"
"youcompleteme"
]; }
];
};
myVim = pkgs.buildEnv {
name = "vim";
paths = [ # paths
myVimConfig
vim-plugins
# steam
ctags
# youtube-dl
# wolfebin
];
};
};
}