-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
104 lines (84 loc) · 2.78 KB
/
vimrc
File metadata and controls
104 lines (84 loc) · 2.78 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
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
syntax on
filetype plugin indent on
"Editor Display Setup
let base16colorspace=256 " Access colors present in 256 colorspace
set nu
set colorcolumn=120
set tabstop=4
set shiftwidth=4
set expandtab
set hlsearch
set incsearch
set laststatus=2 "Set the statusbar so it always displays
set backspace=2 "Sane backspace behaviour
"Persist Undo beyond sessions
set undofile
set undodir=~/.vim/undodir
"Add a manual command to re-run ctags
nnoremap <f5> :!ctags -R -f /.tags<CR>
nnoremap <C-F5> :!ctags -R --fields=+l --languages=python --python-kinds=-iv -f .tags ./<CR>
"Map ctrl+dir keys to move between splits
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
tnoremap <C-J> <C-W><C-J>
tnoremap <C-K> <C-W><C-K>
tnoremap <C-L> <C-W><C-L>
tnoremap <C-H> <C-W><C-H>
"Map <CR> to clear search highlighting
nnoremap <CR> :noh<CR><CR>
"Set splits to the right and below
set splitbelow
set splitright
"Folding Setup
set foldmethod=indent
set foldlevel=99
"Setup syntax for arduino .ino files
autocmd! BufNewFile,BufRead *.ino setlocal ft=arduino
set background=dark
colorscheme gruvbox
"Remove toolbar, menubar, tabbar and scrollbar from gvim
set guioptions-=m
set guioptions-=T
set guioptions-=e
set guioptions-=r
set guioptions-=l
set guioptions-=L
"set guifont=DejaVu_Sans_Mono:h9:cANSI:qDRAFT
"From comments here (http://vim.wikia.com/wiki/Project_specific_settings)
"Setup a .vimlocal for local project settings
silent! so .vimlocal
"Automatically save the session into the default name. Do not restore from the
"default name
autocmd VimLeave * mksession!
" This unfortunately breaks git commit windows. Till I figure out a way to
" filter those out, disabling sourcing the Session of the directory we
" launched from
"silent! so Session.vim
"Setup the terminal debugger
" Use a .vimlocal to set `g:termdebugger` for cross-debugging purposes
packadd termdebug
" Prefer to use the termdebug_config dictionary, but it doesn't seem to work
"set g:termdebug_config['wide']=1
let g:termdebug_wide=1
" Add mapping to move to the program window and close it with <ctrl-\>c.
tnoremap <c-\>c <c-\><c-n>:Program<cr><c-w>:q!<cr>:Gdb<cr>i
" Need to figure out how to handle moving between tabs from terminals
tnoremap <Leader>P <c-\><c-n>:Gdb<cr>i<cr><c-C>load<cr>
" For some reason defaults are getting cleared
hi debugPC term=reverse ctermbg=darkblue guibg=darkblue
hi debugBreakpoint term=reverse ctermbg=red guibg=red
"Setup netrw
let g:netrw_banner = 0
let g:netrw_liststyle = 3
nnoremap <Leader>dd :15Lexplore %:p:h<CR>
nnoremap <Leader>da :15Lexplore<CR>
"Set grep to ignore tags file
let &grepprg="grep --exclude=tags -n $* /dev/null"
au BufRead,BufNewFile *.vimlocal set filetype=vim
"Completion remappings
inoremap ^] ^X^]
inoremap ^F ^X^F
inoremap ^D ^X^D
inoremap ^L ^X^L