-
Notifications
You must be signed in to change notification settings - Fork 0
/
vimrc
executable file
·128 lines (113 loc) · 2.84 KB
/
vimrc
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
"set runtimepath^=~/.vim runtimepath+=~/.vim/after
"let &packpath=&runtimepath
"source ~/.vimrc
""""""""""
" Settings
""""""""""
set number
syntax on
set background=dark
let g:gruvbox_contrast_dark = 'hard'
colorscheme gruvbox
set title
set autoindent
set ignorecase
filetype plugin on
filetype indent plugin on
set clipboard=unnamedplus
set hlsearch
hi Search ctermbg=White
hi Search ctermfg=DarkRed
set novisualbell
set updatetime=100
set foldmethod=indent
set foldlevelstart=20
set relativenumber
set tabstop=8
set softtabstop=0 expandtab
set shiftwidth=4 smarttab
set showbreak=------>
set nomodeline
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
cnoreabbrev Ack Ack!
"""""""""
" Plugins
"""""""""
execute pathogen#infect()
"let g:DirDiffExcludes = ''
let g:airline#extensions#tabline#enabled = 1
set wildignore+=*/.git/*
set wildignore+="*.pyc
set nocst
set rtp+=/home/jack/apps/fzf
let g:pydocstring_templates_path = '/home/jack/.vim/template'
let g:pydocstring_doq_path = '/home/jack/.local/bin/doq'
let g:python3_host_prog = '/home/jack/venv/nvim/bin/python'
let g:pydocstring_formatter = 'google'
let g:pydocstring_doq_path = '/home/jack/Documents/mealcost/mealcost-venv/bin/doq'
"set runtimepath-=~/.vim/bundle/csv.vim
"set runtimepath-=~/.vim/bundle/nerdtree
"set runtimepath-=~/.vim/bundle/vim-airline
"set runtimepath-=~/.vim/bundle/vim-dirdiff
"set runtimepath-=~/.vim/bundle/vim-startify
""""""
" Maps
""""""
nnoremap 0 ^
nnoremap ; :
nnoremap <F3> :bp<cr>
nnoremap <F4> :bn<cr>
nnoremap <F7> :bp<cr>
nnoremap <F8> :bn<cr>
nnoremap <leader>d "_d
nnoremap c ]c
nnoremap C [c
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>
nnoremap <space> za
nnoremap <C-p> :Files<CR>
nnoremap bn :w<cr>:bn<cr>
nnoremap bp :w<cr>:bp<cr>
nnoremap <leader>d "_d
nnoremap <leader>p "_dP
nnoremap <C-n> :NERDTreeToggle<CR>
nnoremap <C-d> :Pydocstring<CR>
inoremap <C-F> <C-X><C-F>
inoremap qq <Esc>
vnoremap d "_d
map <leader>r :NERDTreeFind<cr>
command W w
command Wa wa
command Q q
command Qa qa
command BE BufExplorer
"""""""""""
" Functions
"""""""""""
nnoremap <F2> :call CommentUncomment()<cr>
function! CommentUncomment()
let first_nonwhite=match(getline('.'),'\S')
if first_nonwhite != -1
let first_char=getline('.')[first_nonwhite]
if first_char == "#"
:.s/# //
else
:.s/\(\S\)/# \1/
endif
endif
endfunction
" sync open file with NERDTree
" " Check if NERDTree is open or active
function! IsNERDTreeOpen()
return exists("t:NERDTreeBufName") && (bufwinnr(t:NERDTreeBufName) != -1)
endfunction
" Call NERDTreeFind iff NERDTree is active, current window contains a modifiable
" file, and we're not in vimdiff
function! SyncTree()
if &modifiable && IsNERDTreeOpen() && strlen(expand('%')) > 0 && !&diff
NERDTreeFind
wincmd p
endif
endfunction