-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvimrc
207 lines (195 loc) · 7.39 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
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
set nocompatible " be iMproved, required
set clipboard=unnamed
filetype off " required
command! MakeTags !ctags -R --exclude=node_modules --exclude=release --exclude=.git --exclude=out
set path+=**
noremap tt g<C-]>
nnoremap ,html :-1read $HOME/.vim/templates/html5.html<CR>4ko
iabbrev cbash ```bash<CR>```jkO<BS>
" set the runtime path to include Vundle and initialize
"iabbrev html5 <!DOCTYPE HTML><CR><html><CR><head><CR><meta charset="utf-8"><CR><title><CR></title><CR><meta name="description" content="HTML5 Template"><CR><meta name="author" content="M. Fatih KILIÇ"><CR><link rel="stylesheet" href=""><CR></head><CR><body><CR><CR><CR><script src=""></script><CR></body><CR></html>4ji
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'vim-airline/vim-airline'
Plugin 'altercation/vim-colors-solarized'
Plugin 'christoomey/vim-tmux-navigator'
Plugin 'tpope/vim-surround'
Plugin 'tpope/vim-git'
Plugin 'tpope/vim-fugitive'
Plugin 'Quramy/vim-js-pretty-template'
Plugin 'Chiel92/vim-autoformat'
Plugin 'xolox/vim-easytags'
Plugin 'xolox/vim-misc'
"Plugin 'jelera/vim-javascript-syntax'
"Plugin 'pangloss/vim-javascript'
Plugin 'majutsushi/tagbar'
Plugin 'Valloric/YouCompleteMe'
Plugin 'ternjs/tern_for_vim'
Plugin 'ctrlpvim/ctrlp.vim'
Plugin 'Quramy/tsuquyomi'
"Plugin 'Quramy/tsuquyomi-vue'
Plugin 'posva/vim-vue'
Plugin 'leafgarland/typescript-vim'
Plugin 'digitaltoad/vim-pug'
Plugin 'mxw/vim-jsx'
"Plugin 'othree/yajs.vim'
"" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'fatih/vim-go'
Plugin 'JamshedVesuna/vim-markdown-preview'
Plugin 'vim-scripts/indentpython.vim'
Plugin 'tmhedberg/SimpylFold'
Plugin 'nvie/vim-flake8'
call vundle#end() " required
filetype plugin indent on " required
set encoding=utf-8
syntax enable
let python_highlight_all=1
syntax on
"-----GENERAL-----
inoremap jk <ESC>
let mapleader = "\<Space>"
vnoremap . :norm.<CR>
set hidden
set undofile
set undodir=~/.vim/.undo//
set directory=~/.vim/.swp//
set backupdir=~/.vim/.backup//
set lazyredraw "redraw only when we need to.
set undodir=~/.vim/.undo//
set backupdir=~/.vim/.backup//
set directory=~/.vim/.swp//
set listchars=tab:▸\ ,eol:¬
"------THEME------
set background=dark
" set t_Co="256"
let g:solarized_termtrans = 1
let g:solarized_visibility = "high"
let g:solarized_contrast = "high"
let g:solarized_termcolors=256
colorscheme solarized
" set guifont=Source\ Code\ Pro\ for\ Powerline:h14
set number
set showcmd " show command in bottom bar
set cursorline " highlight current line
set wildmenu " visual autocomplete for command menu
set laststatus=2
set statusline+=%#warningmsg#
set statusline+=%{SyntasticStatuslineFlag()}
set statusline+=%*
"------MOVE AROUND-----
nnoremap <up> <nop>
nnoremap <down> <nop>
nnoremap <left> <nop>
nnoremap <right> <nop>
inoremap <up> <nop>
inoremap <down> <nop>
inoremap <left> <nop>
inoremap <right> <nop>
"-----SEARCH------
set ignorecase
set incsearch
nnoremap <leader>, :noh<cr>
set showmatch
set hlsearch
"----- CTRLP ------
" let g:ctrlp_map = '<c-p>'
" let g:ctrlp_cmd = 'CtrlP'
"-----BUFFER SWITCH-----
nmap <leader>T :enew<cr>
nmap <leader>h :bprevious<cr>
nmap <leader>l :bnext<cr>
"-----SPLIT SCREEN----
nnoremap <silent> vv <C-w>v
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
set splitbelow
set splitright
"-----NERD TREE------
nmap <leader>nt :NERDTreeToggle<cr>
nmap <leader>nf :NERDTreeFocus<cr>
"-----EDIT / RELOAD .vimrc
nmap <silent> <leader>ev :e $MYVIMRC<CR>
nmap <silent> <leader>sv :so $MYVIMRC<CR>
"-----TAGBAR-----
nmap <leader>tb :TagbarToggle<CR>
"----TABS-----
set tabstop=4 " number of visual spaces per TAB
set softtabstop=4 " number of spaces in tab when editing
set shiftwidth=4 " show existing tab with 4 spaces width
set expandtab " On pressing tab, insert 4 spaces
"----ENCODING---
nnoremap <F2> :e ++enc=windows-1254<CR>
nnoremap <F3> :e ++enc=utf-8<CR>
"----FOLDING----
set foldmethod=indent
set foldlevel=99
nnoremap <space> za
"set foldmethod=syntax
"set foldenable
"set foldlevelstart=10
"set foldnestmax=10
"set foldlevel=2
"----PLUGIN : AIRLINE ----
let g:airline_powerline_fonts=1
let g:airline#extensions#tabline#enabled = 1 "Enable the list of buffers
let g:airline#extensions#tabline#fnamemod = ':t' "Show just the filename
let g:airline#extensions#tagbar#enabled = 1
"-----PLUGIN : vim-javascript-----
"set conceallevel=1
"set concealcursor=nvic
" let g:javascript_conceal_function = "ƒ"
" let g:javascript_conceal_null = "ø"
" let g:javascript_conceal_this = "@"
" let g:javascript_conceal_return = "⇚"
" let g:javascript_conceal_undefined = "¿"
" let g:javascript_conceal_NaN = "ℕ"
" let g:javascript_conceal_prototype = "¶"
" let g:javascript_conceal_static = "•"
" let g:javascript_conceal_super = "Ω"
"-----PLUGIN : SYNTASTIC -----
let g:syntastic_check_on_wq = 0
"let g:syntastic_javascript_checkers = ['eslint'] " use jshint
let g:syntastic_javascript_checkers = ['jshint'] " use jshint
let g:syntastic_json_checkers = ['jsonlint'] " use jshint
let g:syntastic_python_checkers = ['python'] " use jshint
" let g:jsx_ext_required = 0 " Allow JSX in normal JS files
let g:syntastic_always_populate_loc_list = 1
let g:syntastic_auto_loc_list = 1
let g:syntastic_check_on_open = 1
"let g:syntastic_auto_jump = 2
"-----PLUGIN : TERN -----
let g:tern_map_keys=1
let g:tern_show_argument_hints='on_hold'
nnoremap <silent> <leader>td :TernDef<cr>
nnoremap <silent> <leader>ts :TernDefSplit<cr>
nnoremap <silent> <leader>tr :TernRefs<cr>
"-----PLUGIN : TAGBAR ------
nnoremap <F8> : TagbarToggle
"-----PLUGIN : YCM -----
let g:ycm_autoclose_preview_window_after_insertion = 1
let g:ycm_autoclose_preview_window_after_completion = 1
map <leader>g :YcmCompleter GoToDefinitionElseDeclaration<CR>
"-----PLUGIN : VIM-GO ------
autocmd FileType go nmap <leader>r :<C-u>GoRun %<cr>
autocmd FileType go nmap <leader>b :<C-u>GoBuild %<cr>
"-----PLUGIN : vim-markdown-preview -----
let vim_markdown_preview_github=1
"let vim_markdown_preview_browser='Google Chrome'
"-----PLUGIN : SimplyFold -----
let g:SimpylFold_docstring_preview=1
highlight BadWhitespace ctermfg=0 ctermbg=236
au BufNewFile,BufRead *.py:
\ set tabstop=4
\ set softtabstop=4
\ set shiftwidth=4
\ set textwidth=79
\ set expandtab
\ set autoindent
\ set fileformat=unix
au BufRead,BufNewFile *.py,*.pyw,*.c,*.h match BadWhitespace /\s\+$/
au FileType xml exe ":silent %!xmllint --format --recover - 2>/dev/null"