This repository was archived by the owner on Jun 29, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvimrc
More file actions
239 lines (187 loc) · 5.4 KB
/
Copy pathvimrc
File metadata and controls
239 lines (187 loc) · 5.4 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
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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
if has('autocmd')
filetype plugin indent on
endif
if has('syntax') && !exists('g:syntax_on')
syntax enable
endif
let mapleader=' '
set autoread
"Turn on line numbers
set number
"
"Copy/Paste in OS clipboard
set clipboard=unnamed
"
"Automatically put selection in visual mode to clipboard, (seems to be broken)
set go+=a
"Set '<' and '>' to match
set matchpairs+=<:>
"Backspace do not delete 'eol'
set bs=indent,start
"Folding
set foldmethod=indent
set foldopen=all
set foldclose=all
"Soft Indentation
set autoindent
set smartindent
set expandtab
set tabstop=2
set shiftwidth=2
set softtabstop=2
"Incremental search with smartcase and backspace behavior
set incsearch
set ignorecase
set smartcase
nmap <silent> <BS> :nohlsearch<CR>
" Put plugins and dictionaries in this dir (also on Windows)
let vimDir = '$HOME/.vim'
let &runtimepath.=','.vimDir
set nrformats-=octal
" Keep undo history across sessions by storing it in a file
if has('persistent_undo')
let myUndoDir = expand(vimDir . '/undodir')
" Create dirs
call system('mkdir ' . vimDir)
call system('mkdir ' . myUndoDir)
let &undodir = myUndoDir
set undofile
set undolevels=5000 " How many undos
set undoreload=10000 " number of lines to save for undo
endif
if &history < 1000
set history=1000
endif
set laststatus=2
set ruler
set wildmenu
set diffopt+=vertical
if !&scrolloff
set scrolloff=1
endif
if !&sidescrolloff
set sidescrolloff=5
endif
set display+=lastline
if &encoding ==# 'latin1' && has('gui_running')
set encoding=utf-8
endif
if &listchars ==# 'eol:$'
set listchars=tab:>\ ,trail:-,extends:>,precedes:<,nbsp:+
endif
if v:version > 703 || v:version == 703 && has("patch541")
set formatoptions+=j " Delete comment character when joining commented lines
endif
if has('path_extra')
setglobal tags-=./tags tags-=./tags; tags^=./tags;
endif
if &tabpagemax < 50
set tabpagemax=50
endif
if !empty(&viminfo)
set viminfo^=!
endif
set sessionoptions-=options
" vim:set ft=vim et sw=2:
"set term=pcansi
"set t_Co=256
"let &t_AB="\e[48;5;%dm"
"let &t_AF="\e[38;5;%dm"
"inoremap <Char-0x07F> <BS>
"nnoremap <Char-0x07F> <BS>
""""""""""""""""""""""""""""""""""""""""
""" let mouse wheel scroll file contents
"""""""""""""""""""""""""""""""""""""""
"set mouse=a
"inoremap <Esc>[62~ <C-X><C-E>
"inoremap <Esc>[63~ <C-X><C-Y>
"nnoremap <Esc>[62~ <C-E>
"nnoremap <Esc>[63~ <C-Y>
"_____________________VIM-PLUG_______________________________________________
" Specify a directory for plugins (for Neovim: ~/.local/share/nvim/plugged)
call plug#begin('~/.vim/plugged')
" On-demand loading
" Plug 'tpope/vim-sensible'
Plug 'tpope/vim-fugitive'
Plug 'airblade/vim-gitgutter'
Plug 'idanarye/vim-merginal'
Plug 'tommcdo/vim-fugitive-blame-ext'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'Xuyuanp/nerdtree-git-plugin'
Plug 'ctrlpvim/ctrlp.vim'
" Plug 'Valloric/YouCompleteMe'
" Colorcheme
Plug 'vim-scripts/twilight256.vim'
Plug 'nanotech/jellybeans.vim'
Plug 'drbraden/near-twilight-256'
Plug 'jiangmiao/auto-pairs'
Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdcommenter'
Plug 'pearofducks/ansible-vim'
" Plug 'gisphm/vim-gradle'
Plug 'tfnico/vim-gradle'
Plug 'gabrielelana/vim-markdown'
Plug 'sjl/gundo.vim'
Plug 'benmills/vimux'
Plug 'tmux-plugins/vim-tmux'
Plug 'mattn/webapi-vim'
Plug 'mattn/pastebin-vim'
" Initialize plugin system
Plug 'christoomey/vim-tmux-navigator'
Plug 'heavenshell/vim-slack'
Plug 'francoiscabrol/ranger.vim'
Plug 'xuhdev/vim-latex-live-preview', { 'for': 'tex' }
call plug#end()
if !has("gui_running")
set term=xterm
""set term=pcansi
set t_Co=256
let &t_AB="\e[48;5;%dm"
let &t_AF="\e[38;5;%dm"
colorscheme twilight256
set background=dark
endif
"____________________Mappings________________________________________________
map <C-n> :NERDTreeToggle<CR>
" NERD Comenter settings
let g:NERDSpaceDelims = 1
let g:NERDCompactSexyComs = 1
let g:NERDDefaultAlign = 'left'
" Ansible syntax settings
let g:ansible_unindent_after_newline = 1
" Fuggitive keybindings
map <Leader>gs :Gstatus<CR>
map <Leader>gw :Gwrite<CR>
map <Leader>gc :Gcommit<CR>
map <Leader>gr :Gread<CR>
map <leader>w :w<CR>
map <leader>q :q<CR>
map <leader>x :wq<CR>
xnoremap <leader>p "_dP
" Run the current file with rspec
map <Leader>rb :call VimuxRunCommand("clear; rspec " . bufname("%"))<CR>
" Prompt for a command to run
map <Leader>vp :VimuxPromptCommand<CR>
" Run last command executed by VimuxRunCommand
map <Leader>vl :VimuxRunLastCommand<CR>
" Inspect runner pane
map <Leader>vi :VimuxInspectRunner<CR>
" Close vim tmux runner opened by VimuxRunCommand
map <Leader>vq :VimuxCloseRunner<CR>
" Interrupt any command running in the runner pane
map <Leader>vx :VimuxInterruptRunner<CR>
" Zoom the runner pane (use <bind-key> z to restore runner pane)
map <Leader>vz :call VimuxZoomRunner()<CR>
let g:tmux_navigator_no_mappings = 1
nnoremap <silent> <c-h> :TmuxNavigateLeft<cr>
nnoremap <silent> <c-j> :TmuxNavigateDown<cr>
nnoremap <silent> <c-k> :TmuxNavigateUp<cr>
nnoremap <silent> <c-l> :TmuxNavigateRight<cr>
nnoremap <silent> <c-\> :TmuxNavigatePrevious<cr>
" PowerLine configuration
python from powerline.vim import setup as powerline_setup
python powerline_setup()
python del powerline_setup
set laststatus=2 " Always display the statusline in all windows
" set showtabline=2 " Always display the tabline, even if there is only one tab
set noshowmode " Hide the default mode text (e.g. -- INSERT -- below the statusline)