This commit is contained in:
Nachuan Tang
2023-02-19 15:06:25 -05:00
11 changed files with 736 additions and 257 deletions
+20 -3
View File
@@ -2,6 +2,12 @@
" Environment {
" get current neovim version
let g:vim_version = -1
" dotfile location
let g:mydotfiles_directory = expand('~/.dotfiles/')
let after_directory = g:mydotfiles_directory . 'config/vi-plugs/coc-theme/after/'
" detect vim type(vim or nvim)
if has('nvim')
let g:vim_type = 'nvim'
let g:vim_version = matchstr(execute('version'), 'NVIM v\zs[^\n]*')
@@ -9,10 +15,19 @@
let g:vim_type = 'vim'
let g:vim_version = matchstr(execute('version'), 'Vi IMproved \zs[^\n]*')
endif
" detect operating system (Windows/Linux/Darwin)
if has("win64") || has("win32") || has("win16")
let g:os = "Windows"
else
let g:os = substitute(system('uname'), '\n', '', '')
endif
let g:vim_version = str2float(g:vim_version)
let g:dotfile_path = '~/.dotfiles/'
set runtimepath^=~/.vim runtimepath+=~/.vim/after
execute('set runtimepath^=' . after_directory)
let &packpath=&runtimepath
" The default leader is '\', but many people prefer ',' as it's in a standard
@@ -80,7 +95,7 @@
"
" set tabpagemax=15 " Only show 15 tabs
" set showmode " Display the current mode
set cursorline " Highlight current line
" set cursorline " Highlight current line
" get rid of current line highlight, instead just highlight the number column
augroup CLClear
@@ -118,15 +133,17 @@
" }
" Formatting {
"set nowrap " Do not wrap long lines
set autoindent " Indent at the same level of the previous line
set shiftwidth=4 " Use indents of 4 spaces
set expandtab " Tabs are spaces, not tabs
set shiftwidth=4 " Use indents of 4 spaces
set tabstop=4 " An indentation every four columns
set softtabstop=4 " Let backspace delete indent
autocmd FileType javascript,typescript set tabstop=2 shiftwidth=2 softtabstop=2
autocmd FileType c,cpp,python,java set tabstop=4 shiftwidth=4 softtabstop=4
set nojoinspaces " Prevents inserting two spaces after punctuation on a join (J)
set splitright " Puts new vsplit windows to the right of the current
set splitbelow " Puts new split windows to the bottom of the current