Repository navigation
Expand file tree
/
Copy path_vimrc
More file actions
143 lines (119 loc) · 4.6 KB
/
Copy path_vimrc
File metadata and controls
143 lines (119 loc) · 4.6 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
" don't bother with vi compatibility
set nocompatible
" enable syntax highlighting
syntax enable
" point to plugins
call plug#begin('~/vimfiles/plugins')
" declare plugins
Plug 'ap/vim-css-color'
Plug 'altercation/vim-colors-solarized'
"Plug 'dense-analysis/ale'
Plug 'frazrepo/vim-rainbow'
Plug 'github/copilot.vim', { 'branch': 'release' }
Plug 'godlygeek/tabular'
Plug 'kien/ctrlp.vim'
Plug 'mechatroner/rainbow_csv'
Plug 'mxw/vim-jsx', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'nathanaelkane/vim-indent-guides'
Plug 'pangloss/vim-javascript', { 'for': ['javascript', 'javascript.jsx'] }
Plug 'othree/yajs.vim'
Plug 'scrooloose/nerdtree'
Plug 'scrooloose/nerdcommenter'
Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive'
Plug 'tpope/vim-sensible'
Plug 'tpope/vim-surround'
Plug 'vim-airline/vim-airline'
Plug 'yggdroot/indentline'
" include plugins
call plug#end()
" copilot
let g:copilot_filetypes = { 'markdown': v:true, 'yaml': v:true }
" NERDTree
autocmd vimenter * NERDTree
" open NERDTree automatically when vim starts up if no files were specified
autocmd StdinReadPre * let s:std_in=1
autocmd VimEnter * if argc() == 0 && !exists("s:std_in") | NERDTree | endif
" open NERDTree automatically when vim starts up on 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 | endif
" close NERDTree when closing file
autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif
" show hidden files
let NERDTreeShowHidden=1
" editor theme
set background=dark
colorscheme solarized
set guifont=Lucida_Console:h13
" key mappings
" set <leader> key
let mapleader=','
" save
nmap <leader>w :w<CR>
" quit
nmap <leader>q :q<CR>
" turn off highlighting
nmap <silent> <leader>n :noh<CR>
" view open buffers
nmap <silent> <leader>b :buffers<CR>
" toggle NERDTree
nmap <silent> <leader>d :NERDTreeToggle<CR>
" open _vimrc
nmap <silent> <leader>ev :e $MYVIMRC<CR>
" source _vimrc
nmap <silent> <leader>sv :so $MYVIMRC<CR>
" change directory to current file
nmap <silent> <leader>cd :cd %:p:h<CR>
" bind vertical scrolling across panes
nmap <silent> <leader>sb :set scrollbind<CR>
" bind vertical scrolling across panes
nmap <silent> <leader>nosb :set noscrollbind<CR>
" exit insert mode
inoremap jj <esc>
" functions
com! FormatJSON %!python -m json.tool
" indent
" set vim-r-plugin to
let r_indent_align_args = 0
" Set vim-r-plugin to mimics ess :
let r_indent_ess_comments = 0
let r_indent_ess_compatible = 0
" miscellaneous options
"syntax on
"filetype plugin indent on
set autoindent " always set autoindenting on
set autoread " reload file on change
set backspace=indent,eol,start " allow backspacing over everything in insert mode
set clipboard=unnamed " copy/paste to system clipboard
set copyindent " copy the previous indentation on autoindenting
set expandtab " replace tabs with spaces
set fileformats=dos " avoid display of unix-style line endings ( ^M )
set hidden " hide buffers rather than close them
set history=1000 " remember more commands and search history
set hlsearch " highlight search terms
set ignorecase " ignore case when searching
set incsearch " show search matches as you type
set laststatus=2 " always display status line
set nobackup " no backup file
set noerrorbells " don't beep
set noswapfile " no swap file
set nowrap " don't wrap lines
set number " always show line numbers
set pastetoggle=<F2>
set shiftround " use multiple of shiftwidth when indenting with '<' and '>'
set shiftwidth=4 " number of spaces to use for autoindenting
set showmatch " set show matching parenthesis
set smartcase " ignore case if search pattern is all lowercase, case-sensitive otherwise
set smarttab " insert tabs on the start of a line according to shiftwidth, not tabstop
set splitbelow " open new buffers beneath current buffer
set splitright " open new buffers to the right of current buffer
set tabstop=4 " a tab is four spaces
set title " change the terminal's title
set undolevels=1000 " use many muchos levels of undo
set visualbell " don't beep
" Load all plugins now.
" Plugins need to be added to runtimepath before helptags can be generated.
packloadall
" Load all of the helptags now, after plugins have been loaded.
" All messages and errors will be ignored.
silent! helptags ALL