-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdot_vimrc
152 lines (118 loc) · 3.28 KB
/
dot_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
150
151
152
set nocompatible
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'VundleVim/Vundle.vim'
Plugin 'jiangmiao/auto-pairs'
Plugin 'ervandew/supertab'
Plugin 'ap/vim-buftabline'
Plugin 'lepture/vim-velocity'
Plugin 'itchyny/lightline.vim'
Plugin 'rust-lang/rust.vim'
call vundle#end()
filetype plugin indent on
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
endif
call plug#begin()
"Plug 'sheerun/vim-polyglot'
"Plug 'honza/vim-snippets'
"Plug 'vim-airline/vim-airline'
Plug 'wbthomason/packer.nvim'
Plug 'arcticicestudio/nord-vim'
"Plug 'dracula/vim', { 'as': 'dracula' }
Plug 'airblade/vim-rooter'
"Plug 'lifepillar/vim-mucomplete'
call plug#end()
" map leader character to space
let mapleader = "\<Space>"
" show line numbers relative to current line
set number
set t_Co=256
set t_ut=
" enable syntax highlighting
filetype plugin on
syntax on
" highlight cursor
set cursorline
" buffer lines when scrolling
set scrolloff=5
" always have status line
set laststatus=2
" change Y behavior to yank from cursor to end of line
nnoremap Y y$
" make seaching nicer
set hlsearch
set incsearch
set ignorecase
set smartcase
" prevent vim from adding ^M
set binary
" leader commands
" enable replace of word under cursor (shortcut <space> s)
nnoremap <Leader>s :%s/\<<C-r><C-w>\>/
" quick save
nnoremap <Leader>w :w<CR>
" remove highlighting
nnoremap <Leader>h :noh<CR>
" destroy buffer
nnoremap <Leader>d :bp\|bd #<CR>
" switch to next buffer
nnoremap <Leader>n :bn<CR>
" switch to previous buffer
nnoremap <Leader>p :bp<CR>
" close vim
nnoremap <Leader>q :q<CR>
" vertical split buffer
nnoremap <Leader>v :vsp<CR>
" make good tabs
set autoindent
set tabstop=4
set softtabstop=0
set expandtab
set shiftwidth=4
"augroup nord-theme-overrides
" autocmd!
" Use 'nord7' as foreground color for Vim comment titles.
" autocmd ColorScheme nord highlight Comment ctermfg=178 guifg=#dfaf00
"augroup END
"colorscheme nord
" fix backspace
set backspace=indent,eol,start
" remove delay for block edits
set timeoutlen=1000 ttimeoutlen=0
" allow vim to have hidden buffers (i.e. unsaved changes in background buffer)
set hidden
" inverse tab bindings
nnoremap <S-Tab> <<
inoremap <S-Tab> <C-d>
" mapping esc to toggling normal/insert
nnoremap <Esc> i
inoremap <Esc> <Esc>l
" Extending to F13
set <F13>=^[[25~
" Toggling normal/insert using Caps Lock
" nnoremap <F13> i
" inoremap <F13> <Esc>l
" Allow wrapping
set wrap
set linebreak
set nolist " list disables linebreak
" Putting right margin
set cc=80
" Setting textwidth 80 for markdown
au BufRead,BufNewFile *.md setlocal textwidth=80
" Will search for tags until root directory
set tags=tags;/
" javacomplete2
autocmd FileType java setlocal omnifunc=javacomplete#Complete
nmap <F6> <Plug>(JavaComplete-Imports-AddMissing)
imap <F6> <Plug>(JavaComplete-Imports-AddMissing)
nmap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
imap <F7> <Plug>(JavaComplete-Imports-RemoveUnused)
" mucomplete
"set completeopt+=menuone
"let g:mucomplete#enable_auto_at_startup = 1
"let g:jedi#popup_on_dot = 0
set clipboard=unnamedplus