-
Notifications
You must be signed in to change notification settings - Fork 0
/
extra
executable file
·105 lines (85 loc) · 2.32 KB
/
extra
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
:colorscheme zenburn
set softtabstop=2
set shiftwidth=4
set tabstop=4
set expandtab
set ignorecase
set smartcase
set gdefault
set incsearch
set showmatch
set hlsearch
filetype plugin indent on
let g:syntastic_enable_signs=1
set t_Co=256
:syntax on
" Ctrl-j/k deletes blank line below/above, and Alt-j/k inserts.
nnoremap <silent><A-j> :set paste<CR>m`o<Esc>``:set nopaste<CR>
nnoremap <silent><A-k> :set paste<CR>m`O<Esc>``:set nopaste<CR>
let mapleader = ","
vmap r "_dP
:cmap W w
:cmap Q q
nnoremap <C-x> :q<CR>
:set number
nnoremap + maO<esc>`a
nnoremap _ mao<esc>`a
map <F2> <Esc>:1,$!xmllint --format -<CR>
map <leader>e :Errors<CR>
map <leader>E :Errors<CR><C-w>j:q<CR>
" window splitting:
nnoremap <leader>h <C-w>v<C-w>l
nnoremap <leader>v <C-w>s<C-w>l
nnoremap <C-h> <C-w>h
nnoremap <C-j> <C-w>j
nnoremap <C-k> <C-w>k
nnoremap <C-l> <C-w>l
" buffer nav:
nnoremap <leader>n :bn<CR>
nnoremap <leader>p :bp<CR>
" statusline:
set statusline=
set statusline+=%-3.3n\ " buffer number
set statusline+=%F\ " filename
set statusline+=%h%m%r%w " status flags
set statusline+=\[%{strlen(&ft)?&ft:'none'}] " file type
set statusline+=%= " right align remainder
set statusline+=0x%-8B " character value
set statusline+=%-14(%l,%c%V%) " line, character
set statusline+=%<%P " file position
" buffer quickview
nnoremap <leader>t :BufExplorer<CR>
" complete paths on tab
set wildmode=list:longest,full
" netrw stuff:
nnoremap <leader>. :e .<CR><CR>
nnoremap ; :e .<CR><CR>
nnoremap <leader>> :Se.<CR>
" taglist
nnoremap <leader>l :TlistToggle<CR>
" folding
nnoremap f za
nnoremap F zR
map a ggVG
nnoremap j zj
nnoremap k zk
" folding js
function! JavaScriptFold()
setl foldmethod=syntax
setl foldlevelstart=1
syn region foldBraces start=/{/ end=/}/ transparent fold keepend extend
function! FoldText()
return substitute(getline(v:foldstart), '{.*', '{...}', '')
endfunction
setl foldtext=FoldText()
endfunction
au FileType javascript call JavaScriptFold()
au FileType javascript setl fen
" yankring
map <leader>y :YRShow<CR>
" json folding crap:
syntax on
set fdm=syntax
set rtp+=/usr/local/opt/fzf
" nnoremap S diw"0P <- proper paste, need new key
set backspace=indent,eol,start