-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path.vimrc
More file actions
165 lines (124 loc) · 3.62 KB
/
Copy path.vimrc
File metadata and controls
165 lines (124 loc) · 3.62 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
set nocompatible
filetype off
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
" let Vundle manage Vundle, required
Plugin 'VundleVim/Vundle.vim'
Plugin 'scrooloose/nerdtree'
Plugin 'scrooloose/syntastic'
Plugin 'tpope/vim-surround'
Plugin 'ntpeters/vim-better-whitespace.git'
Plugin 'airblade/vim-gitgutter'
Plugin 'itchyny/lightline.vim'
Plugin 'airblade/vim-rooter'
Plugin 'dense-analysis/ale'
Plugin 'junegunn/fzf.vim'
Plugin 'editorconfig/editorconfig-vim'
Plugin 'tpope/vim-fugitive'
Plugin 'fatih/vim-go'
Plugin 'rishi-opensource/vim-claude-code'
call vundle#end()
filetype plugin indent on
" General
set number "Line numbers are good
set backspace=indent,eol,start "Allow backspace in insert mode
set history=1000 "Store lots of :cmdline history
set showcmd "Show incomplete cmds down the bottom
set showmode "Show current mode down the bottom
set gcr=a:blinkon0 "Disable cursor blink
set visualbell "No sounds
set autoread "Reload files changed outside vim
set laststatus=2 "Always display the status line
set hidden "Hide buffer instead of closing it
set pastetoggle=<F2> "Paste without being smart
" Swap file and backups
set noswapfile
set nobackup
set nowb
au FocusLost * :wa
" Persistent undo
if has('persistent_undo')
silent !mkdir ~/.vim/backups > /dev/null 2>&1
set undodir=~/.vim/backups
set undofile
endif
" Indentation
set autoindent
set smartindent
set smarttab
set shiftwidth=2
set softtabstop=2
set tabstop=2
set expandtab
" Wrapping
set nowrap "Don't wrap lines
set linebreak "Wrap lines at convenient points
" Folding
set nofoldenable "don't fold by default
set foldmethod=syntax "fold based on syntax
" " Search
set hlsearch
set incsearch
set ignorecase
set showmatch
set smartcase
" " Terminal
set termencoding=utf-8
" " Colors
syntax on
set cursorline
set background=dark
" let g:solarized_termcolors=256
colorscheme torte
highlight clear SignColumn
" " Scrolling
set scrolloff=4
set sidescrolloff=15
set sidescroll=1
" Fix syntax highlighting issues
noremap <F12> <Esc>:syntax sync fromstart<CR>
inoremap <F12> <C-o>:syntax sync fromstart<CR>
" Write with sudo
cmap wi! %!sudo tee > /dev/null %
" Turn off search highlight
nnoremap <leader>a :noh<CR>
" Syntastic
let g:syntastic_mode_map = {
\ "mode": "active",
\ "active_filetypes": ["c", "cpp", "java", "javascript", "python", "ruby"],
\ "passive_filetypes": [] }
" NERDTree
"" Open NERDTree if no files were specified when vim was executed
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
"" Shortcut for toggling NERDTree
map <C-n> :NERDTreeToggle<CR>
let g:better_whitespace_enabled=1
let g:strip_whitespace_on_save=1
"" FZF config
let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -l -g ""'
noremap <C-o> :Files<CR>
"" git gutter
let g:gitgutter_enabled = 1
let g:gitgutter_signs = 1
let g:gitgutter_highlight_lines = 0
let g:lightline = {
\ 'active': {
\ 'left':[ [ 'mode', 'paste' ],
\ [ 'gitbranch', 'readonly', 'filename', 'modified' ]
\ ]
\ },
\ 'component_function': {
\ 'gitbranch': 'fugitive#head',
\ }
\ }
let g:lightline.tabline = {
\ 'left': [ ['tabs'] ],
\ 'right': [ ['close'] ]
\ }
set showtabline=2 " Show tabline
set guioptions-=e " Don't use GUI tabline
let g:EditorConfig_exclude_patterns = ['fugitive://.*']
"" vim-go
let g:go_fmt_command = "goimports"