-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathinit.vim
151 lines (121 loc) · 4.45 KB
/
init.vim
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
" =^..^= =^..^= =^..^= Plugins =^..^= =^..^= =^..^=
call plug#begin('~/.vim/plugged')
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'Shougo/deoplete.nvim', { 'do': ':UpdateRemotePlugins' }
Plug 'tpope/vim-surround'
Plug 'scrooloose/nerdtree', { 'on': 'NERDTreeToggle' }
Plug 'airblade/vim-gitgutter'
Plug 'tpope/vim-fugitive'
Plug 'sheerun/vim-polyglot'
Plug 'mhinz/vim-startify'
Plug 'yuttie/comfortable-motion.vim'
Plug 'easymotion/vim-easymotion'
Plug 'matze/vim-move'
Plug 'preservim/nerdcommenter'
Plug 'drewtempelmeyer/palenight.vim'
Plug 'ryanoasis/vim-devicons'
Plug 'vimwiki/vimwiki'
Plug 'norcalli/nvim-colorizer.lua'
call plug#end()
" Airline
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
let g:airline_symbols.space = "\ua0"
" GitGutter
let g:gitgutter_map_keys = 0
" Nerd Tree
let g:airline_powerline_fonts = 1
let g:NERDTreeChDirMode = 2
let NERDTreeShowBookmarks=1
let NERDTreeQuitOnOpen=1
map <F2> :NERDTreeToggle<CR>
" DevIcons
let g:webdevicons_conceal_nerdtree_brackets = 1
let g:WebDevIconsNerdTreeAfterGlyphPadding = ' '
" Nerd Commenter
let g:NERDSpaceDelims = 1
" <leader>c<space> to togle comments
" TagBar
let g:tagbar_autofocus = 1
map <F3> :TagbarToggle<CR>
" Deoplete
set updatetime=100
let g:deoplete#enable_at_startup = 1
" Gutentags
set statusline+=%{gutentags#statusline()}
" VimWiki
let g:vimwiki_list = [{'path': '~/Dropbox/vimwiki'}]
let g:vimwiki_folding = 'custom'
" Startify
let g:startify_fortune_use_unicode = 1
let g:startify_lists = [
\ { 'type': 'files', 'header': [' MRU'] },
\ { 'type': 'sessions', 'header': [' Sessions'] },
\ { 'type': 'bookmarks', 'header': [' Bookmarks'] },
\ { 'type': 'commands', 'header': [' Commands'] },
\ ]
let g:startify_skiplist = [
\ '\.vimgolf',
\ '^/tmp',
\ '/project/.*/documentation',
\ escape(fnamemodify($HOME, ':p'), '\') .'mysecret.txt',
\ './Dropbox',
\ ] " Add Dropbox folder to the skiplist
" =^..^= =^..^= =^..^= Basic Settings =^..^= =^..^= =^..^=
set autoindent " New lines inherit the indentation of previous lines.
set autoread " Automatically re-read files if unmodified inside Vim
set tabstop=4 " Indent using four spaces
set shiftwidth=4 " When shifting, indent using four spaces
set expandtab " Convert tabs to spaces
set number relativenumber " Show relative numbers on other lines.
set ignorecase " Ignore case when searching
set incsearch " Incremental search that shows partial matches
syntax on " Enable syntax highlighting
set mouse=a " Enable mouse for scrolling and resizing
set autochdir " Automatically change the current directory
set clipboard=unnamedplus " Use the clipboard as the default register
set foldmethod=marker " Activate folding using three curly braces
set scrolloff=5 " Show a few lines of context around the cursor.
" =^..^= =^..^= =^..^= Color scheme =^..^= =^..^= =^..^=
set termguicolors
set background=dark
colorscheme palenight
let g:airline_theme='palenight'
let g:palenight_terminal_italics=1
" =^..^= =^..^= =^..^= Maps =^..^= =^..^= =^..^=
let mapleader =" "
" jj to escape
imap jj <Esc>
" Don't use Ex mode, use Q for formatting.
map Q gq
" Leader + g GitGutter
map <leader>g :map <lt>leader>g<CR>
map <leader>gg :Git<CR><C-W>L<C-W>40<
map <leader>gp :GitGutterPreviewHunk<CR>:wincmd w<CR>
map <leader>gs :GitGutterStageHunk<CR>
map <leader>gf :GitGutterFold<CR>
map <leader>gu :GitGutterUndoHunk<CR>
map <leader>gn :GitGutterNextHunk<CR>
map <leader>gN :GitGutterPrevHunk<CR>
" Leader + s: Remove unwanted spaces
map <leader>s :%s/\s\+$//e<CR>
" Leader + S: Remove unwanted spaces
map <leader>S :Startify<CR>
" Leader + r: Replace each occurrence of the word under the cursor.
map <leader>r :%s/<c-r><c-w>//gc<left><left><left>
" Leader + b/p/n Buffers
nnoremap <leader>b :buffers<CR>:buffer<Space>
nnoremap <leader>N :bprevious<CR>
nnoremap <leader>n :bnext<CR>
" =^..^= =^..^= =^..^= Misc =^..^= =^..^= =^..^=
"Jump to the last position when reopening a file
if has("autocmd")
au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$")
\| exe "normal! g'\"" | endif
endif
" Clear highlight on pressing ESC
nnoremap <silent> <esc> :noh<return><esc>
" Colorizer
lua require'colorizer'.setup()