-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
95 lines (73 loc) · 2.4 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
" Making a new command to comment a range of lines
autocmd FileType c,cpp,java,scala let b:comment_leader = '//'
autocmd FileType sh,ruby,python let b:comment_leader = '#'
autocmd FileType conf,fstab let b:comment_leader = '#'
autocmd FileType tex let b:comment_leader = '%'
autocmd FileType mail let b:comment_leader = '>'
autocmd FileType vim let b:comment_leader = '"'
function! CommentToggle()
execute ':silent! s/\([^ ]\)/' . b:comment_leader . ' \1/'
execute ':silent! s/^\( *\)' . b:comment_leader . ' \?' . b:comment_leader . ' \?/\1/'
endfunction
function! Comment()
execute ':silent! s/^/' . b:comment_leader
endfunction
function! UnComment()
execute ':silent! s/^' . b:comment_leader . '*//'
endfunction
:command -range CC <line1>,<line2>call Comment()<CR>
:command -range UC <line1>,<line2>call UnComment()<CR>
" end
" coder things
set number
set tabstop=4
set shiftwidth=4
set noexpandtab
set autoindent
set hlsearch
"left right wrap
set whichwrap+=<,>,h,l,[,]
nnoremap <F3> :set hlsearch!<CR>
syntax on
se t_Co=256
color elflord
colorscheme latex
"highlight current line must come after color
set cursorline
hi CursorLine cterm=NONE ctermbg=236 ctermfg=NONE guibg=darkred guifg=white
"cterm bg color value visit
"https://upload.wikimedia.org/wikipedia/en/1/15/Xterm_256color_chart.svg
" block guide line
set list
" set listchars=trail:·,precedes:«,extends:»,eol:↲,tab:▸\
set listchars=trail:.,tab:\|\
" :set listchars=trail:.,tab:\|\
set vb t_vb= " Turn off visual bell, error flash
filetype plugin on
" Key mappings
" ==============
" insert mode Shift + Tab
nmap <S-Tab> i
imap <S-Tab> <Nop>
" :imap ii <Esc>
" swap files in temp directories
set dir=/tmp//
"set spell spelllang=en_us
":set nospell
"e TAB to complete when typing words, else inserts TABs as usual.
"Uses dictionary and source files to find matching words to complete.
"
""See help completion for source,
"Note: usual completion is on <C-n> but more trouble to press all the time.
""Never type the same word twice and maybe learn a new spellings!
"Use the Linux dictionary when spelling is in doubt.
""Window users can copy the file to their machine.
function! Tab_Or_Complete()
if col('.')>1 && strpart( getline('.'), col('.')-2, 3 ) =~ '^\w'
return "\<C-N>"
else
return "\<Tab>"
endif
endfunction
:inoremap <Tab> <C-R>=Tab_Or_Complete()<CR>
:set dictionary="/usr/dict/words"