-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy path.vimrc
More file actions
101 lines (86 loc) · 2.11 KB
/
Copy path.vimrc
File metadata and controls
101 lines (86 loc) · 2.11 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
set nocompatible
set backspace=indent,eol,start
set splitright
syntax enable
set mouse=a
set hidden
set ignorecase
set smartcase
set incsearch
set wildmenu
set scrolloff=4
set updatetime=300
if has('persistent_undo')
let s:undo_dir = expand('~/.vim/undo')
if !isdirectory(s:undo_dir)
call mkdir(s:undo_dir, 'p')
endif
let &undodir = s:undo_dir
set undofile
endif
if has('clipboard')
set clipboard=unnamedplus
endif
" Remap common typos
command WQ wq
command Wq wq
command W w
command Q q
let data_dir = expand('~/.vim')
if isdirectory('/opt/homebrew/opt/fzf')
set runtimepath+=/opt/homebrew/opt/fzf
endif
if empty(glob(data_dir . '/autoload/plug.vim'))
echohl WarningMsg
echom 'vim-plug is not installed. Run ./setup.sh to install it.'
echohl None
endif
if !empty(glob(data_dir . '/autoload/plug.vim'))
call plug#begin(data_dir . '/plugged')
Plug 'preservim/nerdtree'
Plug 'preservim/nerdcommenter'
Plug 'phanviet/vim-monokai-pro'
Plug 'vim-airline/vim-airline'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-surround'
Plug 'tpope/vim-repeat'
Plug 'editorconfig/editorconfig-vim'
Plug 'junegunn/fzf.vim'
call plug#end()
endif
filetype plugin indent on
" NERDTree
nnoremap <silent> <C-n> :NERDTreeToggle<CR>
nnoremap <silent> <C-p> :Files<CR>
nnoremap <silent> <Leader>b :Buffers<CR>
nnoremap <silent> <Leader>rg :Rg<Space>
nnoremap <silent> <Leader>t :botright 12split<Bar>terminal ++curwin<CR>
nnoremap <silent> <Leader>a :call <SID>TmuxAgentSplit()<CR>
nnoremap <silent> <S-h> :tabp<CR>
nnoremap <silent> <S-l> :tabn<CR>
autocmd bufenter * if winnr("$") == 1 && &filetype ==# 'nerdtree' | q | endif
function! s:TmuxAgentSplit() abort
if exists('$TMUX')
silent execute '!tmux split-window -v'
redraw!
else
echo 'Not running inside tmux'
endif
endfunction
" Theme
set termguicolors
set background=dark
silent! colorscheme monokai_pro
" Airline
set laststatus=2
set t_Co=256
" Indentation
set sw=2 ts=2 sts=2
set autoindent
set smartindent
set expandtab
set cindent
" Line numbers
set number
set relativenumber
autocmd BufNewFile,BufRead .*,COMMIT_EDITMSG setlocal nonumber norelativenumber