forked from lisiur/vimrc
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.vimrc
More file actions
173 lines (144 loc) · 4.05 KB
/
.vimrc
File metadata and controls
173 lines (144 loc) · 4.05 KB
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
let mapleader=" "
set nocompatible " be iMproved, required
filetype off " required
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'tpope/vim-fugitive'
" MY-PLUGINS
"Plugin 'vim-scripts/indentpython.vim'
"Plugin 'scrooloose/nerdtree'
"Plugin 'Xuyuanp/nerdtree-git-plugin'
"Plugin 'ctrlpvim/ctrlp.vim'
"Plugin 'mileszs/ack.vim'
"Plugin 'easymotion/vim-easymotion'
"Plugin 'Lokaltog/vim-powerline'
"Plugin 'tpope/vim-commentary'
"Plugin 'nathanaelkane/vim-indent-guides'
"Plugin 'vim-scripts/automatic-for-verilog'
"Plugin 'yggdroot/indentLine'
"Plugin 'vim-scripts/vim-systemverilog'
"Plugin 'vim-scripts/LargeFile'
"Plugin 'vim-scripts/molokai'
"Plugin 'mtikekar/vim-bsv'
Plugin 'jiangmiao/auto-pairs'
Plugin 'tmhedberg/matchit'
Plugin 'vim-scripts/verilog_emacsauto.vim'
Plugin 'vim-scripts/Align'
Plugin 'vim-scripts/AutoComplPop'
Plugin 'morhetz/gruvbox'
" All of your Plugins must be added before the following line
call vundle#end() " required
filetype plugin indent on " required
" Generic Config
syntax on
set showtabline=1
set number
set encoding=utf-8
set hls
set incsearch
set hidden
set autoindent
set autoread
set listchars=tab:\>\ ,trail:.,extends:>,precedes:<
nmap <leader> :set list!<CR>
" On Pressing tab, insert spaces
set expandtab
set tabstop=3
set softtabstop=3
set shiftwidth=3
" As most of the stuff is in git anyway
set nobackup
set nowb
set noswapfile
set visualbell
set backspace=indent,eol,start
" Enable wildmenu completion
set wildmenu
set wildmode=list:longest
" patterns to ignore during file-navigation
set wildignore+=.git,.svn,.sass-cache
let g:gruvbox_contrast_dark = 'medium'
if has('gui_running')
if('mac')
set guifont=Source\ Code\ Pro:h10
elseif('unix')
set guifont=Source\ Code\ Pro\ 10
endif
"color molokai
colorscheme gruvbox
set background=dark
set guioptions-=m
set guioptions-=T
endif
" Use persistent undo when available
if has("persistent_undo")
set undodir=~/.vim/undo/
set undofile
endif
" Yank to clipboard by default
if has('unnamedplus')
set clipboard=unnamedplus
else
set clipboard=unnamed
endif
" Plugin Config
" ACK
let g:ackprg = 'ag --nogroup --nocolor --column'
" quick command in insert mode
inoremap II <Esc>I
inoremap AA <Esc>A
inoremap OO <Esc>o
inoremap SS <Esc>S
inoremap CC <Esc>C
" split navigations
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>
" insert new line with staying with normal mode
nnoremap <CR> o<Esc>
nnoremap <S-CR> o<Esc>k
" Force the cursor onto a new line after 80 characters
" set textwidth=80
" In Git commit messages, make it 72 characters
autocmd FileType gitcommit set textwidth=72
" Colour the 73rd column so that we don’t type over our limit
set colorcolumn=+1
" In Git commit messages, also colour the 51st column (for titles)
autocmd FileType gitcommit set colorcolumn+=51
" toggle number / relativenumber
" function! NumberToggle()
" if(&relativenumber == 1)
" set nornu
" else
" set rnu
" endif
" endfunc
" nnoremap <C-n> :call NumberToggle()<cr>
" autocmd FocusLost * :set nornu
" autocmd FocusGained * :set rnu
" autocmd InsertEnter * :set nornu
" autocmd InsertLeave * :set rnu
nnoremap <silent><leader>p :CtrlSpace<CR>
nnoremap <leader><space> :call StripTrailing()<CR>
noremap <silent> <leader>V :source ~/.vimrc<CR>:filetype detect<CR>:exe ":echo 'vimrc reloaded'"<CR>
autocmd BufRead,BufNewFile *.md set filetype=markdown
autocmd BufRead,BufNewFile *.md set spell
" Fix Cursor in TMUX
if exists('$TMUX')
let &t_SI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=1\x7\<Esc>\\"
let &t_EI = "\<Esc>Ptmux;\<Esc>\<Esc>]50;CursorShape=0\x7\<Esc>\\"
else
let &t_SI = "\<Esc>]50;CursorShape=1\x7"
let &t_EI = "\<Esc>]50;CursorShape=0\x7"
endif
" thanks to http://vimcasts.org/e/4
function! StripTrailing()
let previous_search=@/
let previous_cursor_line=line('.')
let previous_cursor_column=col('.')
%s/\s\+$//e
let @/=previous_search
call cursor(previous_cursor_line, previous_cursor_column)
endfunction