Add some packs and README, make the conf usable.

This commit is contained in:
wunewww 2024-05-02 21:44:36 +08:00
parent 3f6ff81c9b
commit 4218db0e9e
8 changed files with 97 additions and 74 deletions

6
.gitmodules vendored
View File

@ -4,9 +4,6 @@
[submodule "pack/plugin/start/vim-fugitive"] [submodule "pack/plugin/start/vim-fugitive"]
path = pack/plugin/start/vim-fugitive path = pack/plugin/start/vim-fugitive
url = https://github.com/tpope/vim-fugitive.git url = https://github.com/tpope/vim-fugitive.git
[submodule "pack/plugin/opt/ale"]
path = pack/plugin/opt/ale
url = https://github.com/dense-analysis/ale.git
[submodule "pack/plugin/opt/nerdtree"] [submodule "pack/plugin/opt/nerdtree"]
path = pack/plugin/opt/nerdtree path = pack/plugin/opt/nerdtree
url = https://github.com/preservim/nerdtree.git url = https://github.com/preservim/nerdtree.git
@ -16,3 +13,6 @@
[submodule "pack/plugin/start/vim-orgmode"] [submodule "pack/plugin/start/vim-orgmode"]
path = pack/plugin/start/vim-orgmode path = pack/plugin/start/vim-orgmode
url = https://github.com/jceb/vim-orgmode.git url = https://github.com/jceb/vim-orgmode.git
[submodule "pack/plugin/start/ale"]
path = pack/plugin/start/ale
url = https://github.com/dense-analysis/ale.git

11
README.md Normal file
View File

@ -0,0 +1,11 @@
# vimfiles
This is wuniu's vim settings. This file describes wuniu's editing experience.
## Load Sequence
1. vimrc and scripts are triggered by vimrc
1. plugins under `plugins/` and scripts triggered by them
1. packs under `pack/plugin/start/` and etc.
1. plugins under `after/plugins/` and etc.

View File

@ -0,0 +1,41 @@
" This is customized file for easymotion package.
packadd vim-easymotion
let g:EasyNotion_do_mapping = 0 " Disable default mapping
map <Leader> <Plug>(easymotion-prefix)
" <Leader>f{char} to move to {char}
map <Leader>f <Plug>(easymotion-bd-f)
nmap <Leader>f <Plug>(easymotion-overwin-f)
" s{char}{char} to move to {char}{char}
nmap s <Plug>(easymotion-overwin-f2)
" Move to line
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)
" Move to word
map <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
" Gif config
nmap s <Plug>(easymotion-s2)
nmap t <Plug>(easymotion-t2)
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
" These `n` & `N` mappings are options. You do not have to map `n` & `N` to EasyMotion.
" Without these mappings, `n` & `N` works fine. (These mappings just provide
" different highlight method and have some other features )
map n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)
" Gif config
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
let g:EasyMotion_startofline = 0 " keep cursor column when JK motion
let g:Easymotion_smartcase = 1

View File

@ -0,0 +1,3 @@
" This is configurations for NerdTree
packadd nerdtree
nnoremap <leader>n :NERDTreeFocus<CR>

15
plugin/01-gui.vim Normal file
View File

@ -0,0 +1,15 @@
" This is special settings for vim-gui.
"
if has("gui_running")
if has("gui_gtk2")
set guifont=Inconsolata\ 12
elseif has("gui_macvim")
set guifont=Menlo\ Regular:h14
elseif has("gui_win32")
set guifont=CaskaydiaMono\ NFM:h12
endif
set go-=T
set go-=m
set go-=r
set go-=L
endif

7
plugin/30-ale.vim Normal file
View File

@ -0,0 +1,7 @@
" Enable completion where available.
" This setting must be set before ALE is loaded.
"
" You should not turn this setting on if you wish to use ALE as a completion
" source for other completion plugins, like Deoplete.
let g:ale_completion_enabled = 1
set omnifunc=ale#completion#OmniFunc

78
vimrc
View File

@ -1,75 +1,17 @@
" This is vimrc file, using as the profile of vim. " This is vimrc file, using as the profile of vim.
" After modify vimrc, use `:so $MYVIMRC` to reload new profile. " After modify vimrc, use `:so $MYVIMRC` to reload new profile.
" This part is only for gvim {{{ " env variables
if has('win32') || has('win64')
if has("gui_running") let g:CONFIGPATH = $USERPROFILE . '/vimfiles'
if has("gui_gtk2") elseif has('unix')
set guifont=Inconsolata\ 12 let g:CONFIGPATH = $HOME . '/.vim'
elseif has("gui_macvim")
set guifont=Menlo\ Regular:h14
elseif has("gui_win32")
set guifont=Consolas:h12
endif endif
set go-=T
set go-=m
set go-=r
set go-=L
endif
" gvim part ends }}}
" Easymotion {{{
packadd! vim-easymotion
let g:EasyNotion_do_mapping = 0 " Disable default mapping
map <Leader> <Plug>(easymotion-prefix)
" <Leader>f{char} to move to {char}
map <Leader>f <Plug>(easymotion-bd-f)
nmap <Leader>f <Plug>(easymotion-overwin-f)
" s{char}{char} to move to {char}{char}
nmap s <Plug>(easymotion-overwin-f2)
" Move to line
map <Leader>L <Plug>(easymotion-bd-jk)
nmap <Leader>L <Plug>(easymotion-overwin-line)
" Move to word
map <Leader>w <Plug>(easymotion-bd-w)
nmap <Leader>w <Plug>(easymotion-overwin-w)
" Gif config
nmap s <Plug>(easymotion-s2)
nmap t <Plug>(easymotion-t2)
map / <Plug>(easymotion-sn)
omap / <Plug>(easymotion-tn)
" These `n` & `N` mappings are options. You do not have to map `n` & `N` to EasyMotion.
" Without these mappings, `n` & `N` works fine. (These mappings just provide
" different highlight method and have some other features )
map n <Plug>(easymotion-next)
map N <Plug>(easymotion-prev)
" Gif config
map <Leader>l <Plug>(easymotion-lineforward)
map <Leader>j <Plug>(easymotion-j)
map <Leader>k <Plug>(easymotion-k)
map <Leader>h <Plug>(easymotion-linebackward)
let g:EasyMotion_startofline = 0 " keep cursor column when JK motion
let g:Easymotion_smartcase = 1
" Easymotion }}}
" ale " ale
" packadd! ale " packadd! ale
" ale " ale
" NerdTree {{{
packadd! nerdtree
nnoremap <leader>n :NERDTreeFocus<CR>
" }}}
filetype plugin indent on " Load plugins according to detected filetype. filetype plugin indent on " Load plugins according to detected filetype.
syntax on " Enable syntax highlighting. syntax on " Enable syntax highlighting.
@ -125,17 +67,21 @@ endif
" Put all temporary files under the same directory. " Put all temporary files under the same directory.
" https://github.com/mhinz/vim-galore#temporary-files " https://github.com/mhinz/vim-galore#temporary-files
set backup set backup
set backupdir =$USERPROFILE/vimfiles/backup/
set backupext =-vimbackup set backupext =-vimbackup
set backupskip = set backupskip =
set directory =$USERPROFILE/vimfiles/swap/
set updatecount =100 set updatecount =100
set undofile set undofile
set undodir =$USERPROFILE/vimfiles/undo/
if exists('g:CONFIGPATH')
execute 'set undodir=' . escape(g:CONFIGPATH, ' \') . '/undo/'
execute 'set directory=' . escape(g:CONFIGPATH, ' \') . '/swap/'
execute 'set backupdir=' . escape(g:CONFIGPATH, ' \') . '/backup/'
endif
" set textwidth =80 " set textwidth =80
set updatetime =300 set updatetime =300
set signcolumn =yes set signcolumn =yes
set smartcase
set foldmethod =manual set foldmethod =manual