improve structure
This commit is contained in:
@@ -7,12 +7,6 @@
|
|||||||
|
|
||||||
" }
|
" }
|
||||||
|
|
||||||
" Use bundles config {
|
|
||||||
if filereadable(expand("~/.vimrc.bundles"))
|
|
||||||
source ~/.vimrc.bundles
|
|
||||||
endif
|
|
||||||
" }
|
|
||||||
|
|
||||||
" General {
|
" General {
|
||||||
|
|
||||||
set background=dark " Assume a dark background
|
set background=dark " Assume a dark background
|
||||||
@@ -33,26 +27,21 @@
|
|||||||
|
|
||||||
filetype plugin indent on " Automatically detect file types.
|
filetype plugin indent on " Automatically detect file types.
|
||||||
syntax on " Syntax highlighting
|
syntax on " Syntax highlighting
|
||||||
syntax enable " Syntax highlighting
|
"set mouse=a " Automatically enable mouse usage
|
||||||
set mouse=a " Automatically enable mouse usage
|
|
||||||
set mousehide " Hide the mouse cursor while typing
|
set mousehide " Hide the mouse cursor while typing
|
||||||
scriptencoding utf-8
|
scriptencoding utf-8
|
||||||
|
|
||||||
|
|
||||||
" Most prefer to automatically switch to the current file directory when
|
" Most prefer to automatically switch to the current file directory when
|
||||||
" a new buffer is opened; to prevent this behavior, add the following to
|
" a new buffer is opened;
|
||||||
" your .vimrc.before.local file:
|
autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
|
||||||
" let g:spf13_no_autochdir = 1
|
" Always switch to the current file directory
|
||||||
if !exists('g:spf13_no_autochdir')
|
|
||||||
autocmd BufEnter * if bufname("") !~ "^\[A-Za-z0-9\]*://" | lcd %:p:h | endif
|
|
||||||
" Always switch to the current file directory
|
|
||||||
endif
|
|
||||||
|
|
||||||
set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter')
|
set shortmess+=filmnrxoOtT " Abbrev. of messages (avoids 'hit enter')
|
||||||
set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility
|
set viewoptions=folds,options,cursor,unix,slash " Better Unix / Windows compatibility
|
||||||
set virtualedit=onemore " Allow for cursor beyond last character
|
set virtualedit=onemore " Allow for cursor beyond last character
|
||||||
set history=1000 " Store a ton of history (default is 20)
|
set history=1000 " Store a ton of history (default is 20)
|
||||||
set spell " Spell checking on
|
set nospell " Spell checking off
|
||||||
set hidden " Allow buffer switching without saving
|
set hidden " Allow buffer switching without saving
|
||||||
set iskeyword-=. " '.' is an end of word designator
|
set iskeyword-=. " '.' is an end of word designator
|
||||||
set iskeyword-=# " '#' is an end of word designator
|
set iskeyword-=# " '#' is an end of word designator
|
||||||
@@ -65,9 +54,6 @@
|
|||||||
|
|
||||||
" http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session
|
" http://vim.wikia.com/wiki/Restore_cursor_to_file_position_in_previous_editing_session
|
||||||
" Restore cursor to file position in previous editing session
|
" Restore cursor to file position in previous editing session
|
||||||
" To disable this, add the following to your .vimrc file:
|
|
||||||
" let g:spf13_no_restore_cursor = 1
|
|
||||||
if !exists('g:spf13_no_restore_cursor')
|
|
||||||
function! ResCur()
|
function! ResCur()
|
||||||
if line("'\"") <= line("$")
|
if line("'\"") <= line("$")
|
||||||
silent! normal! g`"
|
silent! normal! g`"
|
||||||
@@ -79,7 +65,6 @@
|
|||||||
autocmd!
|
autocmd!
|
||||||
autocmd BufWinEnter * call ResCur()
|
autocmd BufWinEnter * call ResCur()
|
||||||
augroup END
|
augroup END
|
||||||
endif
|
|
||||||
|
|
||||||
" Setting up the directories {
|
" Setting up the directories {
|
||||||
set backup " Backups are nice ...
|
set backup " Backups are nice ...
|
||||||
@@ -93,22 +78,13 @@
|
|||||||
" }
|
" }
|
||||||
|
|
||||||
" Vim UI {
|
" Vim UI {
|
||||||
|
"
|
||||||
if filereadable(expand("~/.vim/plugged/vim-colors-solarized/colors/solarized.vim"))
|
|
||||||
let g:solarized_termcolors=256
|
|
||||||
let g:solarized_termtrans=1
|
|
||||||
let g:solarized_contrast="normal"
|
|
||||||
let g:solarized_visibility="normal"
|
|
||||||
call togglebg#map("<F5>")
|
|
||||||
colorscheme solarized
|
|
||||||
endif
|
|
||||||
|
|
||||||
set tabpagemax=15 " Only show 15 tabs
|
set tabpagemax=15 " Only show 15 tabs
|
||||||
set showmode " Display the current mode
|
set showmode " Display the current mode
|
||||||
set cursorline " Highlight current line
|
set cursorline " Highlight current line
|
||||||
|
|
||||||
highlight clear SignColumn " SignColumn should match background
|
"highlight clear SignColumn " SignColumn should match background
|
||||||
highlight clear LineNr " Current line number row will have same background color in relative mode
|
"highlight clear LineNr " Current line number row will have same background color in relative mode
|
||||||
"highlight clear CursorLineNr " Remove highlight color from current line number
|
"highlight clear CursorLineNr " Remove highlight color from current line number
|
||||||
|
|
||||||
if has('cmdline_info')
|
if has('cmdline_info')
|
||||||
@@ -160,15 +136,9 @@
|
|||||||
|
|
||||||
set matchpairs+=<:> " Match, to be used with %
|
set matchpairs+=<:> " Match, to be used with %
|
||||||
set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
|
set comments=sl:/*,mb:*,elx:*/ " auto format comment blocks
|
||||||
" Remove trailing whitespaces and ^M chars
|
|
||||||
" To disable the stripping of whitespace, add the following to your
|
|
||||||
" .vimrc.before.local file:
|
|
||||||
" let g:spf13_keep_trailing_whitespace = 1
|
|
||||||
"autocmd FileType c,cpp,java,go,php,javascript,puppet,python,rust,twig,xml,yml,perl,sql autocmd BufWritePre <buffer> if !exists('g:spf13_keep_trailing_whitespace') | call StripTrailingWhitespace() | endif
|
|
||||||
"autocmd FileType go autocmd BufWritePre <buffer> Fmt
|
|
||||||
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
autocmd BufNewFile,BufRead *.html.twig set filetype=html.twig
|
||||||
autocmd FileType haskell,puppet,ruby,yml setlocal expandtab shiftwidth=2 softtabstop=2
|
autocmd FileType haskell,puppet,ruby,yml setlocal expandtab shiftwidth=2 softtabstop=2
|
||||||
" preceding line best in a plugin but here for now.
|
|
||||||
|
|
||||||
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
|
autocmd BufNewFile,BufRead *.coffee set filetype=coffee
|
||||||
|
|
||||||
@@ -181,12 +151,10 @@
|
|||||||
|
|
||||||
" Key (re)Mappings {
|
" Key (re)Mappings {
|
||||||
|
|
||||||
|
|
||||||
" Wrapped lines goes down/up to next row, rather than next line in file.
|
" Wrapped lines goes down/up to next row, rather than next line in file.
|
||||||
noremap j gj
|
noremap j gj
|
||||||
noremap k gk
|
noremap k gk
|
||||||
|
|
||||||
|
|
||||||
" Stupid shift key fixes
|
" Stupid shift key fixes
|
||||||
if !exists('g:spf13_no_keyfixes')
|
if !exists('g:spf13_no_keyfixes')
|
||||||
if has("user_commands")
|
if has("user_commands")
|
||||||
@@ -337,20 +305,6 @@
|
|||||||
endfunction
|
endfunction
|
||||||
" }
|
" }
|
||||||
|
|
||||||
" Strip whitespace {
|
|
||||||
function! StripTrailingWhitespace()
|
|
||||||
" Preparation: save last search, and cursor position.
|
|
||||||
let _s=@/
|
|
||||||
let l = line(".")
|
|
||||||
let c = col(".")
|
|
||||||
" do the business:
|
|
||||||
%s/\s\+$//e
|
|
||||||
" clean up: restore previous search history, and cursor position
|
|
||||||
let @/=_s
|
|
||||||
call cursor(l, c)
|
|
||||||
endfunction
|
|
||||||
" }
|
|
||||||
|
|
||||||
" Shell command {
|
" Shell command {
|
||||||
function! s:RunShellCommand(cmdline)
|
function! s:RunShellCommand(cmdline)
|
||||||
botright new
|
botright new
|
||||||
@@ -367,7 +321,6 @@
|
|||||||
call setline(2, substitute(a:cmdline, '.', '=', 'g'))
|
call setline(2, substitute(a:cmdline, '.', '=', 'g'))
|
||||||
execute 'silent $read !' . escape(a:cmdline, '%#')
|
execute 'silent $read !' . escape(a:cmdline, '%#')
|
||||||
setlocal nomodifiable
|
setlocal nomodifiable
|
||||||
1
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
command! -complete=file -nargs=+ Shell call s:RunShellCommand(<q-args>)
|
command! -complete=file -nargs=+ Shell call s:RunShellCommand(<q-args>)
|
||||||
@@ -407,11 +360,11 @@
|
|||||||
|
|
||||||
" TIPS: :hi can be used to check current highlight options
|
" TIPS: :hi can be used to check current highlight options
|
||||||
" Coc has wired floating color, this is an attempt to fix it
|
" Coc has wired floating color, this is an attempt to fix it
|
||||||
highlight CocFloating ctermbg=green
|
" highlight CocFloating ctermbg=green
|
||||||
highlight FgCocErrorFloatBgCocFloating cterm=bold ctermfg=124 guifg=DarkRed ctermbg=green
|
" highlight FgCocErrorFloatBgCocFloating cterm=bold ctermfg=124 guifg=DarkRed ctermbg=green
|
||||||
|
|
||||||
" c highlight fix
|
" c highlight fix
|
||||||
highlight cComment ctermfg=12 guifg=#458588
|
" highlight cComment ctermfg=12 guifg=#458588
|
||||||
|
|
||||||
" copy to system
|
" copy to system
|
||||||
set clipboard=unnamed
|
set clipboard=unnamed
|
||||||
@@ -431,3 +384,9 @@
|
|||||||
exec "set t_PE=\e[201~"
|
exec "set t_PE=\e[201~"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
" Use bundles config {
|
||||||
|
if filereadable(expand("~/.vimrc.bundles"))
|
||||||
|
source ~/.vimrc.bundles
|
||||||
|
endif
|
||||||
|
" }
|
||||||
|
|
||||||
|
|||||||
+36
-16
@@ -2,15 +2,8 @@
|
|||||||
|
|
||||||
" Basics {
|
" Basics {
|
||||||
set nocompatible " Must be first line
|
set nocompatible " Must be first line
|
||||||
|
|
||||||
" }
|
" }
|
||||||
" }
|
" }
|
||||||
|
|
||||||
|
|
||||||
" Deps {
|
|
||||||
"Plug 'MarcWeber/vim-addon-mw-utils'
|
|
||||||
"Plug 'tomtom/tlib_vim'
|
|
||||||
" }
|
|
||||||
"
|
"
|
||||||
" Plugin directory
|
" Plugin directory
|
||||||
let plugin_dir = '~/.vim/plugged/'
|
let plugin_dir = '~/.vim/plugged/'
|
||||||
@@ -31,15 +24,18 @@
|
|||||||
Plug 'alvan/vim-closetag'
|
Plug 'alvan/vim-closetag'
|
||||||
let g:closetag_filenames = '*.html,*.xhtml,*.phtml, *.js'
|
let g:closetag_filenames = '*.html,*.xhtml,*.phtml, *.js'
|
||||||
" }
|
" }
|
||||||
|
|
||||||
|
"{
|
||||||
Plug 'altercation/vim-colors-solarized'
|
Plug 'altercation/vim-colors-solarized'
|
||||||
"Plug 'lifepillar/vim-solarized8'
|
"}
|
||||||
"Plug 'spf13/vim-colors'
|
|
||||||
Plug 'scrooloose/nerdtree'
|
Plug 'scrooloose/nerdtree'
|
||||||
|
|
||||||
" for markdown{
|
" for markdown{
|
||||||
Plug 'godlygeek/tabular'
|
Plug 'godlygeek/tabular'
|
||||||
Plug 'preservim/vim-markdown'
|
Plug 'preservim/vim-markdown'
|
||||||
"}
|
"}
|
||||||
|
|
||||||
" for window resize{
|
" for window resize{
|
||||||
Plug 'simeji/winresizer'
|
Plug 'simeji/winresizer'
|
||||||
let g:winresizer_start_key = '<C-r>'
|
let g:winresizer_start_key = '<C-r>'
|
||||||
@@ -58,7 +54,7 @@
|
|||||||
Plug 'mg979/vim-visual-multi'
|
Plug 'mg979/vim-visual-multi'
|
||||||
" }
|
" }
|
||||||
Plug 'vim-airline/vim-airline'
|
Plug 'vim-airline/vim-airline'
|
||||||
Plug 'vim-airline/vim-airline-themes'
|
"Plug 'vim-airline/vim-airline-themes'
|
||||||
|
|
||||||
" For nvim-bufferline
|
" For nvim-bufferline
|
||||||
" {
|
" {
|
||||||
@@ -73,15 +69,20 @@
|
|||||||
if executable('fzf')
|
if executable('fzf')
|
||||||
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
Plug 'projekt0n/github-nvim-theme'
|
||||||
|
Plug 'nanotech/jellybeans.vim'
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
" Plugin Preferences
|
" Plugin Preferences
|
||||||
"
|
" {
|
||||||
" NerdTree {
|
" NerdTree {
|
||||||
if isdirectory(expand(plugin_dir . "/nerdtree"))
|
if isdirectory(expand(plugin_dir . "/nerdtree"))
|
||||||
let g:NERDShutUp=1
|
let g:NERDShutUp=1
|
||||||
nnoremap <C-e> :NERDTreeToggle<CR>
|
nnoremap <C-e> :NERDTreeToggle<CR>
|
||||||
nmap <leader>e :NERDTreeFind<CR>
|
nnoremap <leader>e :NERDTreeToggle<CR>
|
||||||
|
"nmap <leader>e :NERDTreeFind<CR>
|
||||||
|
|
||||||
let NERDTreeShowBookmarks=1
|
let NERDTreeShowBookmarks=1
|
||||||
"let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$']
|
"let NERDTreeIgnore=['\.py[cd]$', '\~$', '\.swo$', '\.swp$', '^\.git$', '^\.hg$', '^\.svn$', '\.bzr$']
|
||||||
@@ -116,10 +117,9 @@
|
|||||||
let g:airline_section_y = ''
|
let g:airline_section_y = ''
|
||||||
|
|
||||||
if isdirectory(expand(plugin_dir . "/vim-airline-themes/"))
|
if isdirectory(expand(plugin_dir . "/vim-airline-themes/"))
|
||||||
if !exists('g:airline_theme')
|
"let g:airline_theme = 'solarized'
|
||||||
let g:airline_theme = 'solarized'
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
" }
|
||||||
|
|
||||||
" junegunnjunegunn/fzf {
|
" junegunnjunegunn/fzf {
|
||||||
" [Buffers] Jump to the existing window if possible
|
" [Buffers] Jump to the existing window if possible
|
||||||
@@ -128,4 +128,24 @@
|
|||||||
noremap <leader>f :FZF<CR>
|
noremap <leader>f :FZF<CR>
|
||||||
" }
|
" }
|
||||||
|
|
||||||
" }
|
" {
|
||||||
|
"projekt0n/github-nvim-theme
|
||||||
|
|
||||||
|
" has('nvim') check if it's running on nvim rather than
|
||||||
|
" having neovim on your machine
|
||||||
|
if isdirectory(expand(plugin_dir . "/github-nvim-theme")) && has('nvim')
|
||||||
|
let g:github_function_style = "italic"
|
||||||
|
let g:github_sidebars = ["qf", "vista_kind", "terminal", "packer"]
|
||||||
|
set background=dark
|
||||||
|
colorscheme github_dark
|
||||||
|
endif
|
||||||
|
" }
|
||||||
|
|
||||||
|
" {
|
||||||
|
" nanotech/jellybeans.vim
|
||||||
|
if isdirectory(expand(plugin_dir . "/jellybeans.vim")) && !has('nvim')
|
||||||
|
colorscheme jellybeans
|
||||||
|
endif
|
||||||
|
|
||||||
|
" }
|
||||||
|
" }
|
||||||
|
|||||||
+5
-13
@@ -1,11 +1,11 @@
|
|||||||
REM This script is for configurating vim on windows 10 machine
|
:: This script is for configurating vim on windows 10 machine
|
||||||
REM
|
|
||||||
|
|
||||||
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
|
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
|
||||||
@if not exist "%HOME%" @set HOME=%USERPROFILE%
|
@if not exist "%HOME%" @set HOME=%USERPROFILE%
|
||||||
|
|
||||||
@set NVIM_CONFIG_PATH=%HOME%\appdata\local\nvim\init.vim
|
@set NVIM_CONFIG_PATH=%HOME%\appdata\local\nvim\init.vim
|
||||||
@set APP_PATH=%HOME%\.dotfiles
|
@set APP_PATH=%HOME%\.dotfiles
|
||||||
|
|
||||||
IF NOT EXIST "%APP_PATH%" (
|
IF NOT EXIST "%APP_PATH%" (
|
||||||
call git clone "https://github.com/Donaldttt/dotfiles" "%APP_PATH%"
|
call git clone "https://github.com/Donaldttt/dotfiles" "%APP_PATH%"
|
||||||
) ELSE (
|
) ELSE (
|
||||||
@@ -17,23 +17,15 @@ IF NOT EXIST "%APP_PATH%" (
|
|||||||
call cd "%APP_PATH%"
|
call cd "%APP_PATH%"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
:: Install vim-plug
|
||||||
|
curl -fLo %HOME%/vimfiles/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
|
||||||
|
|
||||||
call mklink "%HOME%\.vimrc" "%APP_PATH%\.vimrc"
|
call mklink "%HOME%\.vimrc" "%APP_PATH%\.vimrc"
|
||||||
call mklink "%HOME%\.vimrc.bundles" "%APP_PATH%\.vimrc.bundles"
|
call mklink "%HOME%\.vimrc.bundles" "%APP_PATH%\.vimrc.bundles"
|
||||||
|
|
||||||
IF NOT EXIST "%APP_PATH%\.vim" (
|
IF NOT EXIST "%APP_PATH%\.vim" (
|
||||||
call mkdir "%APP_PATH%\.vim"
|
call mkdir "%APP_PATH%\.vim"
|
||||||
)
|
)
|
||||||
IF NOT EXIST "%APP_PATH%\.vim\bundle" (
|
|
||||||
call mkdir "%APP_PATH%\.vim\bundle"
|
|
||||||
)
|
|
||||||
|
|
||||||
IF NOT EXIST "%HOME%/.vim/bundle/vundle" (
|
|
||||||
call git clone https://github.com/gmarik/vundle.git "%HOME%/.vim/bundle/vundle"
|
|
||||||
) ELSE (
|
|
||||||
call cd "%HOME%/.vim/bundle/vundle"
|
|
||||||
call git pull
|
|
||||||
call cd %HOME%
|
|
||||||
)
|
|
||||||
|
|
||||||
if exist "%NVIM_CONFIG_PATH%" (
|
if exist "%NVIM_CONFIG_PATH%" (
|
||||||
move "%NVIM_CONFIG_PATH%" "%NVIM_CONFIG_PATH%.backup""
|
move "%NVIM_CONFIG_PATH%" "%NVIM_CONFIG_PATH%.backup""
|
||||||
|
|||||||
Reference in New Issue
Block a user