-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
executable file
·172 lines (142 loc) · 3.51 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
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
" .vimrc
"Plugins
call plug#begin()
Plug 'itchyny/lightline.vim'
Plug 'tpope/vim-surround'
Plug 'airblade/vim-gitgutter'
Plug 'ctrlpvim/ctrlp.vim'
Plug 'ervandew/supertab'
Plug 'tpope/vim-fugitive'
Plug 'mg979/vim-visual-multi'
Plug 'easymotion/vim-easymotion'
Plug 'dominikduda/vim_current_word'
Plug 'arcticicestudio/nord-vim'
Plug 'preservim/nerdtree'
Plug 'mbbill/undotree'
Plug 'christoomey/vim-tmux-navigator'
call plug#end()
"Lightline
set noshowmode
set laststatus=2
let g:lightline = {
\ 'colorscheme': 'nord',
\ }
"Colors
syntax enable
colorscheme nord
set background=dark
"GUI Options
if has('gui')
set guifont=Consolas:h12:b
set guioptions-=T "remove toolbar
set guioptions-=t "remove tearoff options
set guioptions-=L "remove left-hand scroll bar
set lines=40 columns=85
set shell=C:\WINDOWS\system32\cmd.exe
else
if has("termguicolor")
set termguicolors
end
end
"Encoding
set encoding=utf-8
"GitGutter
set updatetime=250
let g:gitgutter_sign_added = '+'
let g:gitgutter_sign_removed = '-'
let g:gitgutter_sign_modified = 'Δ'
let g:gitgutter_sign_modified_removed = 'Δ-'
"Line numbers
set number
"Tabs
set tabstop=4
set shiftwidth=4
set scrolloff=10
"Indentation
set autoindent
set smartindent
"Fix backspace
if has('gui')
set backspace=2
end
"Split opening positions
set splitright
set splitbelow
"Remove error bells
set noerrorbells visualbell t_vb=
autocmd GUIEnter * set visualbell t_vb=
"Keep cursor relatively centered
set scrolloff=10
"Performance improvements
set lazyredraw
set ttyfast
set t_ut=
"Search
set incsearch
set ignorecase
set smartcase
"Read if file changes
set autoread
"Autocomplete
set wildmenu
set completeopt=menu,menuone
inoremap <expr> <CR> pumvisible() ? "\<C-y>" : "\<C-g>u\<CR>"
"Remap Leader Key
let mapleader = "," " map leader to comma
"NerdTree Quick Access
noremap <leader>n :NERDTreeToggle<CR>
inoremap <leader>n :NERDTreeToggle<CR>
vnoremap <leader>n :NERDTreeToggle<CR>
"undotree Quick Access
noremap <leader>u :UndotreeToggle<CR>
inoremap <leader>u :UndotreeToggle<CR>
vnoremap <leader>u :UndotreeToggle<CR>
"undotree configurations
let g:undotree_WindowLayout = 3
let g:undotree_ShortIndicators = 1
"Cursor and Whitespace
set cursorline
:hi CursorLine cterm=NONE ctermbg=darkgray ctermfg=white guibg=darkgray guifg=white
:hi CursorColumn cterm=NONE ctermbg=darkgray ctermfg=white guibg=darkgray guifg=white
:noremap <Leader>l :set cursorline! <CR>
:noremap <Leader>c :set cursorcolumn! <CR>
:inoremap <Leader>l :set cursorline! <CR>
:inoremap <Leader>c :set cursorcolumn! <CR>
:vnoremap <Leader>l :set cursorline! <CR>
:vnoremap <Leader>c :set cursorcolumn! <CR>
"Whitespace
set list
set listchars=tab:\→\ ,trail:∴
set showbreak=\ ↩\
"Visual Cursor
let &t_SI = "\e[5 q"
let &t_EI = "\e[2 q"
"Quick Escape
inoremap ;; <Esc>
vnoremap ;; <Esc>
onoremap ;; <Esc>
"Fingers are already there...
nnoremap <C-j> <C-d>
nnoremap <C-k> <C-u>
vnoremap <C-j> <C-d>
vnoremap <C-k> <C-u>
"Because shift is hard to let go of okay
command! Wq wq
command! WQ wq
command! W w
command! Q q
"EMOJI SUPPORT!!!
command! EmojiReplace %s/:\([^:]\+\):/\=emoji#for(submatch(1), submatch(0))/g
" Persistent Undo
if has("persistent_undo")
let target_path = expand('~/.undodir')
" create the directory and any parent directories
" if the location does not exist.
if !isdirectory(target_path)
call mkdir(target_path, "p", 0700)
endif
let &undodir=target_path
set undofile
endif
" Syntax stuff
autocmd Filetype gitcommit setlocal spell textwidth=72 " Git commit messages