-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
146 lines (130 loc) · 3.34 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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
execute pathogen#infect()
syntax enable
filetype plugin indent on
let g:syntastic_python_checkers = ['flake8']
" Line number improvements
set number
set rnu
augroup numbertoggle
autocmd!
autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
augroup END
set cursorline
" Make netrw better
let g:netrw_browse_split = 2
let g:netrw_winsize = 25
let g:netrw_liststyle = 3
" Colorscheme settings
set background=dark
set t_Co=256
let g:gruvbox_termcolors=256
let g:gruvbox_contrast_dark='dark'
let g:gruvbox_hls_cursor='blue'
colorscheme gruvbox
" Standardize indentation
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set autoindent
set cindent
" Better search
set incsearch
" Allow folding
set incsearch
set foldenable
set foldlevelstart=10
set foldnestmax=10
set foldmethod=indent
" Make finding files more useful
set wildmenu
set wildmode=list:longest,full
set wildignore+=**/virtualenv_run/**,*.pyc,*.pyo,__pycache__
set path=$PWD/**
setglobal complete-=i " No indexing of massive files for ctrl-n/p
" Allow moving by wrapping
:noremap <Up> gk
:noremap! <Up> <C-O>gk
:noremap <Down> gj
:noremap! <Down> <C-O>gj
" Better tags (This requires Exuberant Ctags)
set tag=./tags;
let g:gutentags_generate_on_new = 1
let g:gutentags_generate_on_missing = 1
let g:gutentags_generate_on_write = 1
let g:gutentags_generate_on_empty_buffer = 0
if !executable('ctags')
let g:gutentags_dont_load = 1
endif
let g:gutentags_cache_dir = expand('~/.cache/vim/ctags/')
let g:gutentags_ctags_exclude = [
\ '*.svg',
\ '*/tests/*',
\ 'build',
\ 'dist',
\ '*sites/*/files/*',
\ 'bin',
\ 'node_modules',
\ 'bower_components',
\ 'cache',
\ 'compiled',
\ 'docs',
\ 'example',
\ 'bundle',
\ 'vendor',
\ '*.md',
\ '*-lock.json',
\ '*.lock',
\ '*bundle*.js',
\ '*build*.js',
\ '.*rc*',
\ '*.json',
\ '*.min.*',
\ '*.map',
\ '*.bak',
\ '*.zip',
\ '*.pyc',
\ '*.class',
\ '*.sln',
\ '*.Master',
\ '*.csproj',
\ '*.tmp',
\ '*.csproj.user',
\ '*.cache',
\ '*.pdb',
\ 'tags*',
\ 'cscope.*',
\ '*.css',
\ '*.less',
\ '*.scss',
\ '*.exe', '*.dll',
\ '*.mp3', '*.ogg', '*.flac',
\ '*.swp', '*.swo',
\ '*.bmp', '*.gif', '*.ico', '*.jpg', '*.png',
\ '*.rar', '*.zip', '*.tar', '*.tar.gz', '*.tar.xz', '*.tar.bz2',
\ '*.pdf', '*.doc', '*.docx', '*.ppt', '*.pptx',
\ ]
" ---- Functions ----
" Magically copy yank buffer to system clipboard with Osc52
" Only works in iTerm2 - make sure to enable clipboard access
function! Osc52Yank()
let buffer=system('base64 -w0', @0)
let buffer=substitute(buffer, "\n$", "", "")
let buffer='\e]52;c;'.buffer.'\x07'
if $TMUX != ''
let buffer='\ePtmux;\e'.buffer.'\e\\'
endif
silent exe "!echo -ne ".shellescape(buffer)." > ".shellescape("/dev/tty")
endfunction
command! Osc52CopyYank call Osc52Yank()
nnoremap <leader>y :Osc52CopyYank<cr>:redr!<cr>
" Make vim automatically set paste/nopaste when pasting stuff
let &t_SI .= "\<Esc>[?2004h"
let &t_EI .= "\<Esc>[?2004l"
inoremap <special> <expr> <Esc>[200~ XTermPasteBegin()
function! XTermPasteBegin()
set pastetoggle=<Esc>[201~
set paste
return ""
endfunction