-
Notifications
You must be signed in to change notification settings - Fork 0
/
.vimrc-cygwin
232 lines (201 loc) · 8.75 KB
/
.vimrc-cygwin
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
" .vimrc@rescenic - heavily inspired by: @millermedeiros
" Last Update: May 16 2021
" Vundle begins here; turn off filetype temporarily
" Set the runtime path to include Vundle and initialize
set nocompatible
set viminfo=%,\"100,'10,/50,:100,h,f0,n~/.viminfo
filetype off
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" Let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
" Plugins
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'preservim/nerdtree'
Plugin 'Xuyuanp/nerdtree-git-plugin'
Plugin 'ryanoasis/vim-devicons'
" Themes
Plugin 'vim-airline/vim-airline'
Plugin 'vim-airline/vim-airline-themes'
Plugin 'edkolev/tmuxline.vim'
Plugin 'morhetz/gruvbox'
call vundle#end()
syntax on
filetype plugin indent on " Enable detection, plugins and indent.
set spelllang=en_us " Spell-checking.
set encoding=utf-8 nobomb " BOM often causes trouble.
" Performance & buffer settings
set hidden " Can put buffer to the background without writing
" to disk, will remember history/marks.
set lazyredraw " Don't update the display while executing macros.
set ttyfast " Send more characters at a given time.
" History & file handling settings
set history=99 " Increase history (default = 20).
set undolevels=99 " More undo (default=100).
set autoread " Reload files if changed externally.
" Backup settings
set nobackup
set nowritebackup
set noswapfile
" Search & regexp settings
set gdefault " RegExp global by default.
set magic " Enable extended regexes.
set hlsearch " Highlight searches.
set incsearch " Show the `best match so far' as typed.
set ignorecase smartcase " Make searches case-insensitive, unless they
" contain upper-case letters.
" Keys settings
set backspace=indent,eol,start " Allow backspacing over everything.
set esckeys " Allow cursor keys in insert mode.
set nostartofline " Make j/k respect the columns
" set virtualedit=all " Allow the cursor to go in to 'invalid' places.
set timeoutlen=1000 " How long it wait for mapped commands.
set ttimeoutlen=100 " Faster timeout for escape key and others.
" ----------------------------------------------------------------------------
" UI
" ----------------------------------------------------------------------------
set t_Co=256 " 256 colors terminal.
colorscheme gruvbox
set background=dark
" vim-airline
let g:airline_theme='gruvbox'
let g:airline#extensions#tabline#formatter = 'unique_tail'
let g:airline_powerline_fonts = 1
let g:airline_highlighting_cache = 1
" vim-tmuxline
let g:tmuxline_preset = 'full'
set mouse=a
if has("mouse_sgr")
set ttymouse=sgr
else
set ttymouse=xterm2
end
set cursorline " Highlight current line.
set laststatus=2 " Always show status line.
set number relativenumber " Enable relative line numbers.
set nu rnu " Enable hybrid line numbers.
set numberwidth=4 " Width of numbers line (default on gvim is 4).
set report=0 " Show all changes.
set showmode " Show the current mode.
set showcmd " Show partial command on last line of screen.
set showmatch " Show matching parenthesis.
set splitbelow splitright " How to split new windows.
set title " Show the filename in the window title bar.
set scrolloff=5 " Start scrolling n lines before horizontal
" border of window.
set sidescrolloff=7 " Start scrolling n chars before end of screen.
set sidescroll=1 " The minimal number of columns to scroll
" horizontally.
" --- command completion ---
set wildmenu " Hitting TAB in command mode will
set wildchar=<TAB> " show possible completions.
set wildmode=list:longest
set wildignore+=*.DS_STORE,*.db
" --- diff ---
set diffopt=filler " Add vertical spaces to keep right
" and left aligned.
set diffopt+=iwhite " Ignore whitespace changes.
" --- folding---
set foldmethod=indent "fold based on indent
set foldnestmax=3 "deepest fold is 3 levels
set nofoldenable "don't fold by default
" --- list chars ---
" list spaces and tabs to avoid trailing spaces and mixed indentation
" see key mapping at the end of file to toggle `list`
set fillchars=fold:-
set list
" --- remove sounds effects ---
set noerrorbells
set visualbell
" -----------------------------------------------------------------------------
" KEYS
" -----------------------------------------------------------------------------
set backspace=indent,eol,start " allow backspacing over everything.
set esckeys " Allow cursor keys in insert mode.
set nostartofline " Make j/k respect the columns.
"set virtualedit=all " Allow the cursor to go in to 'invalid' places.
" -----------------------------------------------------------------------------
" INDENTATION AND TEXT-WRAP
" -----------------------------------------------------------------------------
set expandtab " Expand tabs to spaces.
set autoindent smartindent " Auto/smart indent.
set copyindent " Copy previous indentation on auto indent.
set softtabstop=4 " Tab key results in # spaces.
set tabstop=4 " Tab is 4 spaces.
set shiftwidth=4 " The # of spaces for indenting.
set smarttab " At start of line, <Tab> inserts shift width
" spaces, <Bs> deletes shift width spaces.
set wrap " Wrap lines.
set textwidth=94
set colorcolumn=+1 " Show large lines
set lines=52
set formatoptions=qrn1 " Automatic formating.
set formatoptions-=o " Don't start new lines w/ comment leader on
" pressing 'o'
set nomodeline " Don't use modeline (security).
set pastetoggle=<leader>p " Paste mode: avoid auto indent, treat chars
" as literal.
" -----------------------------------------------------------------------------
" PLUGINS
" -----------------------------------------------------------------------------
" --- ctrlp ---
let g:ctrlp_map = '<c-p>'
" --- NERDTree ----
let NERDTreeIgnore=['.DS_Store']
let NERDTreeShowBookmarks=0 " Show bookmarks on startup.
let NERDTreeHighlightCursorline=1 " Highlight the selected entry in the tree.
let NERDTreeShowLineNumbers=0
let NERDTreeMinimalUI=1
let NERDTreeShowHidden=1
" --- vim-devicons ---
" loading the plugin
let g:webdevicons_enable = 1
" adding the flags to NERDTree
let g:webdevicons_enable_nerdtree = 1
" adding the custom source to unite
let g:webdevicons_enable_unite = 1
" adding the column to vimfiler
let g:webdevicons_enable_vimfiler = 1
" adding to vim-airline's tabline
let g:webdevicons_enable_airline_tabline = 1
" adding to vim-airline's statusline
let g:webdevicons_enable_airline_statusline = 1
" ctrlp glyphs
let g:webdevicons_enable_ctrlp = 1
" adding to vim-startify screen
let g:webdevicons_enable_startify = 1
" adding to flagship's statusline
let g:webdevicons_enable_flagship_statusline = 1
" turn on/off file node glyph decorations (not particularly useful)
let g:WebDevIconsUnicodeDecorateFileNodes = 1
" use double-width(1) or single-width(0) glyphs
" only manipulates padding, has no effect on terminal or set(guifont) font
let g:WebDevIconsUnicodeGlyphDoubleWidth = 1
" whether or not to show the nerdtree brackets around flags
let g:webdevicons_conceal_nerdtree_brackets = 1
" the amount of space to use after the glyph character (default ' ')
let g:WebDevIconsNerdTreeAfterGlyphPadding = ' '
" Force extra padding in NERDTree so that the filetype icons line up vertically
let g:WebDevIconsNerdTreeGitPluginForceVAlign = 1
" Adding the custom source to denite
let g:webdevicons_enable_denite = 1
" The amount of space to use after the glyph character in vim-airline tabline(default '')
let g:WebDevIconsTabAirLineAfterGlyphPadding = ' '
" The amount of space to use before the glyph character in vim-airline tabline(default ' ')
let g:WebDevIconsTabAirLineBeforeGlyphPadding = ' '
" -----------------------------------------------------------------------------
" KEYS MAPPING
" -----------------------------------------------------------------------------
" vim-nerdtree
map <C-n> :NERDTreeToggle<CR>
" remap keys
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-h> <C-w>h
nnoremap <C-l> <C-w>l
" vim-buffer
map gn :bn<cr>
map gp :bp<cr>
map gd :bd<cr>
" Remove all trailing whitespace by pressing F4
noremap <F4> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>