-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
147 lines (127 loc) · 3.73 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
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
" Make sure you use single quotes
Plug 'kien/ctrlp.vim'
Plug 'plasticboy/vim-markdown'
Plug 'lifepillar/vim-solarized8'
"Plug 'airblade/vim-gitgutter'
Plug 'itchyny/lightline.vim'
Plug 'tpope/vim-sleuth'
Plug 'fatih/vim-go', { 'do': ':GoUpdateBinaries' }
Plug 'prettier/vim-prettier', { 'do': 'yarn install' }
Plug 'yuezk/vim-js'
Plug 'maxmellon/vim-jsx-pretty'
" Initialize plugin system
call plug#end()
set ai " auto indenting
set hlsearch " highlight the last searched term
set nocompatible
set encoding=utf-8
set scrolloff=3
set showmode
set showcmd
set hidden
set wildmode=list:longest
set visualbell
set ttyfast
set undofile
set ignorecase
set smartcase
set gdefault
set showmatch
set hlsearch
set wrap
set textwidth=79
set formatoptions=qrn1
set guifont=InputMonoCondensed\ Regular\ 12
let g:lightline = {
\ 'colorscheme': 'wombat',
\ 'component': {
\ 'readonly': '%{&readonly?"":""}',
\ },
\ 'separator': { 'left': '', 'right': '' },
\ 'subseparator': { 'left': '', 'right': '' }
\ }
" let g:lightline = {
" \ 'colorscheme': 'wombat',
" \ 'component': {
" \ 'readonly': '%{&readonly?"":""}',
" \ },
" \ 'separator': { 'left': '', 'right': '' },
" \ 'subseparator': { 'left': '', 'right': '' }
" \ }
colorscheme wombat256
if has("gui_running")
set lines=60 columns=120
endif
let g:go_highlight_functions = 1
let g:go_highlight_methods = 1
let g:go_highlight_structs = 1
let g:vim_markdown_folding_disabled=1
if $COLORTERM == 'gnome-terminal'
set t_Co=256
endif
if $COLORTERM == 'xfce4-terminal'
set t_Co=256
endif
if &term =~ '256color'
" disable Background Color Erase (BCE) so that color schemes
" render properly when inside 256-color tmux and GNU screen.
" see also http://snk.tuxfamily.org/log/vim-256color-bce.html
set t_ut=
endif
if (has("termguicolors"))
set termguicolors
endif
"Map jk to ESC
inoremap jk <ESC>
"Map leader to space
nnoremap <SPACE> <Nop>
let mapleader = " "
"Run current buffer with node (and save it before)
nnoremap <leader>rn :w<CR> :!node %<CR>
set clipboard=unnamed
"The following line makes webpack watch-mode more reliable
:set backupcopy=yes
let g:ctrlp_working_path_mode = 'rw'
let g:ctrlp_custom_ignore = '\v([\/]\.(git|hg|svn))|(node_modules)$'
let g:ctrlp_root_markers = ['.ctrlp']
function! DoPrettyXML()
" save the filetype so we can restore it later
let l:origft = &ft
set ft=
" delete the xml header if it exists. This will
" permit us to surround the document with fake tags
" without creating invalid xml.
1s/<?xml .*?>//e
" insert fake tags around the entire document.
" This will permit us to pretty-format excerpts of
" XML that may contain multiple top-level elements.
0put ='<PrettyXML>'
$put ='</PrettyXML>'
silent %!xmllint --encode UTF-8 --format -
" xmllint will insert an <?xml?> header. it's easy enough to delete
" if you don't want it.
" delete the fake tags
2d
$d
" restore the 'normal' indentation, which is one extra level
" too deep due to the extra tags we wrapped around the document.
silent %<
" back to home
1
" restore the filetype
exe "set ft=" . l:origft
endfunction
command! PrettyXML call DoPrettyXML()
com! PrettyJSON %!python -m json.tool
let g:jsx_ext_required = 0
set undodir=~/.vim/tmp
set wildignore+=node_modules/**,.git,*.o,*.a,*.class,*.mo,*.la,*.so,*.obj,*.swp,*.jpg,*.png,*.xpm,*.gif,*.pdf,*.bak
set suffixes+=.class
" Map CTRL-L to switch to prev buffer in case CTRL-^ and CTRL-6 don't work
nmap <C-l> :b#<CR>
nnoremap ü ]
nnoremap Ü [