-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
150 lines (129 loc) · 3.58 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
" Begin {
set nocompatible
source ~/.vimrc.fn
" }
" VIM bundles {
filetype off
call plug#begin('~/.vim/plugged')
source ~/.vimrc.bundles
call plug#end()
filetype plugin indent on " required!
" }
" Mapping keys {
let mapleader=','
nnoremap ; :
" }
"
" Basic settings {
set hidden
set modeline
set ruler
set autoread
set completeopt-=preview
set nostartofline " do not jump to 1st charactor with page commands
set nowrap " don't wrap lines
set autoindent " always set autoindenting on
set smartindent " smart indent
"set relativenumber " enter relativenumber mode
set number " always show line numbers
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set showmatch " set show matching parenthesis
set smarttab " insert tabs on the start of a line according to shiftwidth, not tabstop
set cindent " copy the previous indentation on autoindenting
set noswapfile " no swap files
set signcolumn=yes
set ttyfast
"set lazyredraw
syntax on " enable syntax hightlight
" }
"
" Tabs, ident and width {
set tabstop=4 " a tab is two spaces
"set backspace=4 " allow backspacing over everything in insert mode
set backspace=indent,eol,start
set shiftwidth=4 " number of spaces to use for autoindenting
set softtabstop=4 "
set expandtab
" }
" UI, colorscheme {
" set mono world
set background=dark
silent! colorscheme inori
"hi Normal ctermbg=237 ctermfg=252
"hi ColorColumn ctermbg=236
"hi Search ctermbg=241
"hi SignColumn ctermbg=237
"hi LineNr ctermfg=250
"hi CursorLineNr ctermfg=250
"hi Tabline cterm=none ctermbg=236 ctermfg=254
"hi TabLineFill cterm=none ctermbg=236
"hi StatusLine cterm=none ctermbg=238
"hi StatusLineNC cterm=none ctermbg=250
"hi CursorLine cterm=bold ctermbg=236
"hi MatchParen ctermbg=none ctermfg=1
"hi Pmenu ctermbg=238 ctermfg=254
" let &colorcolumn="".join(range(100,999), ",")
"set colorcolumn=+1
" }
" Keyboard && remapping mapping {
" Fix sometime stupid key moving
nnoremap j gj
nnoremap k gk
" Easy window navigation
map <C-h> <C-w>h
map <C-j> <C-w>j
map <C-k> <C-w>k
map <C-l> <C-w>l
" Setting for quick copy & paste
vnoremap Y "+y
vnoremap D "+d
nnoremap YY "+yy
nnoremap P "+p
vnoremap P "+p
" tab
noremap tn :tabnew<CR>
noremap tc :tabclose<CR>
noremap tt gt.
noremap qq :q<CR>
noremap wq :wq<CR>
" Toggle between normal and relative numbering.
nnoremap <leader>r :set relativenumber!<cr>
" auto insert end block
inoremap {<CR> {<CR>}<Esc>O
inoremap [<CR> [<CR>]<Esc>O<Tab>
" Close other
noremap <leader>o :on<CR>
" Use jj for esc
imap jj <Esc>
" remap for auto complete
"inoremap <leader>, <C-x><C-o>
" }
" Search and text replace {
set noignorecase " Make searching case insensitive
set smartcase " ... unless the query has capital letters.
set magic " Use 'magic' patterns (extended regular expressions).
set nohlsearch
" Search and Replace
nmap <Leader>s :%s//g<Left><Left>
" }
" Load Plugins settings {
if !empty(glob('~/.vimrc.plugins.settings'))
source ~/.vimrc.plugins.settings
endif
" }
" Auto complete {
"set omnifunc=syntaxcomplete#Complete
set completeopt=longest,menuone
"}
" Auto cmd {
autocmd BufWritePre <buffer> call Delete_trailing()
" }
"
set pastetoggle=<F2>
"augroup numbertoggle
"autocmd!
"autocmd BufEnter,FocusGained,InsertLeave * set relativenumber
"autocmd BufLeave,FocusLost,InsertEnter * set norelativenumber
"augroup END
set updatetime=500
set mouse=a