-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.vimrc
110 lines (82 loc) · 2.89 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
" (N)Vim Configuration File
" vim : place in $HOME/.vimrc
" nvim : place in $HOME/.config/nvim/init.vim
" $ ln -s $HOME/.config/nvim/init.vim $HOME/.vimrc
" General settings
" https://learnvimscriptthehardway.stevelosh.com/
" ---------------------------------------------------------------------------
" drop vi support - kept for vim compatibility but not needed for nvim
" Probably not needed with Vim 8+
set nocompatible
" fzf
set rtp+=/opt/homebrew/opt/fzf
" Keybinding
" This clear the search highlight on after return key pressed
nnoremap <CR> :noh<CR><CR>
" Search recursively downward from CWD; provides TAB completion for filenames
" e.g., `:find vim* <TAB>`
set path+=**
" number of lines at the beginning and end of files checked for file-specific vars
set modelines=0
" reload files changed outside of Vim not currently modified in Vim (needs below)
set autoread
" http://stackoverflow.com/questions/2490227/how-does-vims-autoread-work#20418591
au FocusGained,BufEnter * :silent! !
" use Unicode
set encoding=utf-8
" errors flash screen rather than emit beep
set visualbell
" make Backspace work like Delete
set backspace=indent,eol,start
" don't create `filename~` backups
set nobackup
" don't create temp files
set noswapfile
" line numbers and distances
set relativenumber
set number
" number of lines offset when jumping
set scrolloff=2
" Tab key enters 2 spaces
" To enter a TAB character when `expandtab` is in effect,
" CTRL-v-TAB
set expandtab tabstop=2 shiftwidth=2 softtabstop=2
" Indent new line the same as the preceding line
set autoindent
" statusline indicates insert or normal mode
set showmode showcmd
" make scrolling and painting fast
" ttyfast kept for vim compatibility but not needed for nvim
set ttyfast lazyredraw
" highlight matching parens, braces, brackets, etc
set showmatch
" http://vim.wikia.com/wiki/Searching
set hlsearch incsearch ignorecase smartcase
" As opposed to `wrap`
"set nowrap
" http://vim.wikia.com/wiki/Set_working_directory_to_the_current_file
set autochdir
" open new buffers without saving current modifications (buffer remains open)
set hidden
" http://stackoverflow.com/questions/9511253/how-to-effectively-use-vim-wildmenu
set wildmenu wildmode=list:longest,full
" StatusLine always visible, display full path
" http://learnvimscriptthehardway.stevelosh.com/chapters/17.html
set laststatus=2 statusline=%F
" Use system clipboard
" http://vim.wikia.com/wiki/Accessing_the_system_clipboard
" for linux
"set clipboard=unnamedplus
" for macOS
set clipboard=unnamed
" Folding
" https://vim.fandom.com/wiki/Folding
" https://vim.fandom.com/wiki/All_folds_open_when_opening_a_file
" https://stackoverflow.com/questions/8316139/how-to-set-the-default-to-unfolded-when-you-open-a-file
set foldmethod=indent
set foldnestmax=1
set foldlevelstart=1
" netrw and vim-vinegar
let g:netrw_browse_split = 3
" For podfile
autocmd BufNewFile,BufRead Podfile,*.podspec set filetype=ruby