-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
126 lines (103 loc) · 4.2 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
"=============================================================================="
" Vim Configurations
" Author: Robb Currall <[email protected]>
" Version: 19.12.10
"
" Some useful resources that I am utilizing to determine my configurations:
" - https://dougblack.io/words/a-good-vimrc.html#spaces
" - http://ctrlpvim.github.io/ctrlp.vim/#installation
"=============================================================================="
"=============================================================================="
" Initialization
"=============================================================================="
set nocompatible
filetype off
set encoding=UTF-8
set number
set autoread
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call plug#begin('~/.vim/plugged')
" Plugins
Plug 'ctrlpvim/ctrlp.vim'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdcommenter'
Plug 'cespare/vim-toml'
Plug 'neoclide/coc.nvim', {'branch': 'release'}
Plug 'tpope/vim-fugitive'
Plug 'chiel92/vim-autoformat'
Plug 'tpope/vim-surround'
Plug 'scrooloose/syntastic'
Plug 'vim-airline/vim-airline'
Plug 'airblade/vim-gitgutter'
Plug 'tiagofumo/vim-nerdtree-syntax-highlight'
Plug 'dracula/vim'
Plug 'ryanoasis/vim-devicons'
call plug#end()
filetype plugin indent on
"=============================================================================="
" Appearance
"=============================================================================="
set colorcolumn=80,120
hi ColorColumn ctermbg=lightgrey guibg=lightgrey
colorscheme dracula
"=============================================================================="
" Key Remaps
"=============================================================================="
inoremap jk <esc>
"=============================================================================="
" Tabs and Spaces
"=============================================================================="
set tabstop=8
set softtabstop=0
set shiftwidth=4
set smarttab
set expandtab
"=============================================================================="
" Searching
"=============================================================================="
set incsearch
set hlsearch
nnoremap <leader><space> :nohlsearch<CR>
"=============================================================================="
" Folding
"=============================================================================="
set foldenable
set foldlevelstart=10
set foldnestmax=10
set foldmethod=indent
"=============================================================================="
" Fuzzy Search with Ripgrep
"=============================================================================="
" Use Ripgrep if available
if executable('rg')
set grepprg=rg\ --color=never
let g:ctrlp_user_command = 'rg %s --files --color=never --glob ""'
let g:ctrlp_use_caching = 0
endif
"=============================================================================="
" Tmux compatibility
"=============================================================================="
if $TERM =~ 'screen'
nnoremap <C-A> <nop>
nnoremap <Leader><C-A> <C-a>
endif
"=============================================================================="
" NERD Settings
"=============================================================================="
" Automatically Open when opening a directory
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 1 && isdirectory(argv()[0]) && !exists("s:std_in") | exe 'NERDTree' argv()[0] | wincmd p | ene | exe 'cd '.argv()[0] | endif
" Map Ctrl+n to toggle NERDTree
map <C-n> :NERDTreeToggle<CR>
" Close Vim if NERDTree is only window open
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" Highlighting settings
let g:NERDTreeFileExtensionHighlightFullName = 1
let g:NERDTreeExactMatchHighlightFullName = 1
let g:NERDTreePatternMatchHighlightFullName = 1
let g:NERDTreeHighlightFolders = 1 " enables folder icon highlighting using exact match
let g:NERDTreeHighlightFoldersFullName = 1 " highlights the folder name
let g:syntastic_php_checkers = ['php', 'phpcbf', 'phpcs']
let g:syntastic_php_phpcs_args='--standard=PSR12 -n'
let g:syntastic_php_phpcfb_args='--standard=PSR12 -n'