Compare commits
No commits in common. "211ee2eb40f23ebdddf0da8eee53fface17c20a0" and "8668ee16d070139ff1b99e3adfa12a1bf1aa47c0" have entirely different histories.
211ee2eb40
...
8668ee16d0
3 changed files with 136 additions and 113 deletions
|
@ -1,39 +1,43 @@
|
|||
vim9script
|
||||
set encoding=utf-8
|
||||
scriptencoding utf-8
|
||||
|
||||
def EnsureDir(dir: string): void
|
||||
if filewritable(dir) != 2
|
||||
mkdir(dir, "p", 0700)
|
||||
function! s:ensure_dir(dir)
|
||||
if filewritable(a:dir) != 2
|
||||
call mkdir(a:dir, "p", 0700)
|
||||
endif
|
||||
enddef
|
||||
endfunction
|
||||
|
||||
# These are really clever - minpac will actually be loaded on the fly only
|
||||
# when you need to update or clean your packages, rather than all the time.
|
||||
command! PackUpdate source $XDG_CONFIG_HOME/vim/plugins.vim | minpac#update()
|
||||
command! PackClean source $XDG_CONFIG_HOME/vim/plugins.vim | minpac#clean()
|
||||
command! PackStatus source $XDG_CONFIG_HOME/vim/plugins.vim | minpac#status()
|
||||
if exists('+packpath')
|
||||
" These are really clever - minpac will actually be loaded on the fly only
|
||||
" when you need to update or clean your packages, rather than all the time.
|
||||
command! PackUpdate source $XDG_CONFIG_HOME/vim/plugins.vim | call minpac#update()
|
||||
command! PackClean source $XDG_CONFIG_HOME/vim/plugins.vim | call minpac#clean()
|
||||
command! PackStatus source $XDG_CONFIG_HOME/vim/plugins.vim | call minpac#status()
|
||||
|
||||
# If the pack directory doesn't exist, we haven't installed any packages yet,
|
||||
# so let's call PackUpdate.
|
||||
if !isdirectory($XDG_CACHE_HOME .. '/vim/pack')
|
||||
" If the pack directory doesn't exist, we haven't installed any packages yet,
|
||||
" so let's call PackUpdate.
|
||||
if !isdirectory($XDG_CACHE_HOME . '/vim/pack')
|
||||
PackUpdate
|
||||
endif
|
||||
else
|
||||
" If we're on a version of Vim that doesn't have packages, we have to load a
|
||||
" plugin manager (vim-plug) on every boot.
|
||||
source $XDG_CONFIG_HOME/vim/plugins.vim
|
||||
endif
|
||||
|
||||
augroup transparent_term
|
||||
autocmd!
|
||||
autocmd ColorScheme * highlight Normal ctermbg=NONE guibg=NONE
|
||||
augroup END
|
||||
|
||||
set background=dark
|
||||
g:gruvbox_italic = 1
|
||||
g:gruvbox_improved_strings = 1
|
||||
g:gruvbox_improved_warnings = 1
|
||||
let g:gruvbox_italic=1
|
||||
let g:gruvbox_improved_strings=1
|
||||
let g:gruvbox_improved_warnings=1
|
||||
|
||||
if has('gui_running') || has('termguicolors')
|
||||
set termguicolors
|
||||
silent! packadd gruvbox
|
||||
g:airline_theme = 'gruvbox'
|
||||
let g:airline_theme = 'gruvbox'
|
||||
colorscheme gruvbox
|
||||
else
|
||||
colorscheme inkpot
|
||||
|
@ -53,9 +57,6 @@ set linebreak showbreak=↩
|
|||
set modelines=5
|
||||
set showcmd
|
||||
set wildmode=longest,full
|
||||
if has('patch-8.2.4325')
|
||||
set wildoptions+=pum
|
||||
endif
|
||||
|
||||
set tabstop=2 shiftwidth=2
|
||||
|
||||
|
@ -69,8 +70,8 @@ else
|
|||
set number
|
||||
endif
|
||||
|
||||
for dir in ['backup', 'swap', 'undo']
|
||||
EnsureDir($XDG_STATE_HOME .. '/vim/' .. dir)
|
||||
for s:dir in ['backup', 'swap', 'undo']
|
||||
call s:ensure_dir($XDG_STATE_HOME . '/vim/' . s:dir)
|
||||
endfor
|
||||
|
||||
set backupdir=.,$XDG_STATE_HOME/vim/backup
|
||||
|
@ -80,22 +81,22 @@ if exists('+undofile')
|
|||
set undodir=$XDG_STATE_HOME/vim/undo
|
||||
endif
|
||||
|
||||
g:airline_powerline_fonts = 1
|
||||
g:airline#extensions#battery#enabled = 1
|
||||
let g:airline_powerline_fonts = 1
|
||||
let g:airline#extensions#battery#enabled = 1
|
||||
|
||||
g:csv_no_conceal = 1
|
||||
let g:csv_no_conceal = 1
|
||||
|
||||
g:vim_svelte_plugin_use_typescript = 1
|
||||
let vim_svelte_plugin_use_typescript = 1
|
||||
|
||||
g:LatexBox_Folding = 1
|
||||
g:NERDTreeHijackNetrw = 1
|
||||
let g:LatexBox_Folding = 1
|
||||
let g:NERDTreeHijackNetrw = 1
|
||||
|
||||
g:ale_set_balloons = 1
|
||||
let g:ale_set_balloons = 1
|
||||
nmap <silent> <C-k> <Plug>(ale_previous_wrap)
|
||||
nmap <silent> <C-j> <Plug>(ale_next_wrap)
|
||||
|
||||
g:mucomplete#can_complete = {
|
||||
default: {
|
||||
omni: (t) => strlen(&l:omnifunc) > 0 && t =~# '\m\k\%(\k\|\.\)$'
|
||||
}
|
||||
}
|
||||
let g:mucomplete#can_complete = {
|
||||
\'default': {
|
||||
\'omni': {t -> strlen(&l:omnifunc) > 0 && t =~# '\m\k\%(\k\|\.\)$'}
|
||||
\}
|
||||
\}
|
||||
|
|
|
@ -1,87 +1,116 @@
|
|||
vim9script
|
||||
silent! packadd minpac
|
||||
if !exists('g:loaded_minpac')
|
||||
if exists('+packpath')
|
||||
silent! packadd minpac
|
||||
if !exists('g:loaded_minpac')
|
||||
silent !git clone https://github.com/k-takata/minpac.git $XDG_CACHE_HOME/vim/pack/minpac/opt/minpac
|
||||
augroup minpac {
|
||||
augroup minpac
|
||||
autocmd!
|
||||
autocmd VimEnter * call minpac#update()
|
||||
}
|
||||
augroup END
|
||||
endif
|
||||
|
||||
function! Plug(...)
|
||||
call call('minpac#add', a:000)
|
||||
endfunction
|
||||
|
||||
function! PlugEnd()
|
||||
endfunction
|
||||
|
||||
packadd minpac
|
||||
|
||||
call minpac#init({'dir': $XDG_CACHE_HOME . '/vim'})
|
||||
else
|
||||
if !filereadable($XDG_CACHE_HOME . '/vim/autoload/plug.vim')
|
||||
silent !curl -fLo $XDG_CACHE_HOME/vim/autoload/plug.vim --create-dirs 'https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
|
||||
augroup vimplug
|
||||
autocmd VimEnter * PlugInstall
|
||||
augroup END
|
||||
endif
|
||||
|
||||
function! Plug(name, ...)
|
||||
call plug#(a:name)
|
||||
endfunction
|
||||
|
||||
function! PlugEnd()
|
||||
call plug#end()
|
||||
endfunction
|
||||
|
||||
call plug#begin($XDG_CACHE_HOME . '/vim/plugged')
|
||||
endif
|
||||
packadd minpac
|
||||
|
||||
minpac#init({dir: $XDG_CACHE_HOME .. '/vim'})
|
||||
minpac#add('k-takata/minpac', {type: 'opt'})
|
||||
minpac#add('tpope/vim-sensible')
|
||||
minpac#add('prabirshrestha/async.vim')
|
||||
call Plug('k-takata/minpac', {'type': 'opt'})
|
||||
call Plug('tpope/vim-sensible')
|
||||
call Plug('prabirshrestha/async.vim')
|
||||
|
||||
minpac#add('ciaranm/inkpot', {type: 'opt', do: 'colorscheme inkpot'})
|
||||
minpac#add('morhetz/gruvbox', {type: 'opt'})
|
||||
call Plug('ciaranm/inkpot', {'type': 'opt', 'do': 'colorscheme inkpot'})
|
||||
call Plug('morhetz/gruvbox', {'type': 'opt'})
|
||||
|
||||
minpac#add('direnv/direnv.vim')
|
||||
minpac#add('editorconfig/editorconfig-vim')
|
||||
minpac#add('godlygeek/tabular')
|
||||
minpac#add('jamessan/vim-gnupg')
|
||||
minpac#add('junegunn/vim-easy-align')
|
||||
minpac#add('lifepillar/vim-mucomplete')
|
||||
minpac#add('lotabout/skim')
|
||||
minpac#add('lotabout/skim.vim')
|
||||
minpac#add('mhinz/vim-signify')
|
||||
minpac#add('scrooloose/nerdtree')
|
||||
minpac#add('sjl/vitality.vim')
|
||||
minpac#add('tpope/vim-apathy')
|
||||
minpac#add('tpope/vim-commentary')
|
||||
minpac#add('tpope/vim-dadbod')
|
||||
minpac#add('tpope/vim-endwise')
|
||||
minpac#add('tpope/vim-eunuch')
|
||||
minpac#add('tpope/vim-fugitive')
|
||||
minpac#add('tpope/vim-repeat')
|
||||
minpac#add('tpope/vim-rhubarb')
|
||||
minpac#add('tpope/vim-sleuth')
|
||||
minpac#add('tpope/vim-surround')
|
||||
minpac#add('tpope/vim-unimpaired')
|
||||
call Plug('direnv/direnv.vim')
|
||||
call Plug('editorconfig/editorconfig-vim')
|
||||
call Plug('godlygeek/tabular')
|
||||
call Plug('jamessan/vim-gnupg')
|
||||
call Plug('junegunn/vim-easy-align')
|
||||
call Plug('lifepillar/vim-mucomplete')
|
||||
call Plug('lotabout/skim')
|
||||
call Plug('lotabout/skim.vim')
|
||||
call Plug('mhinz/vim-signify')
|
||||
call Plug('scrooloose/nerdtree')
|
||||
call Plug('sjl/vitality.vim')
|
||||
call Plug('tpope/vim-apathy')
|
||||
call Plug('tpope/vim-commentary')
|
||||
call Plug('tpope/vim-dadbod')
|
||||
call Plug('tpope/vim-endwise')
|
||||
call Plug('tpope/vim-eunuch')
|
||||
call Plug('tpope/vim-fugitive')
|
||||
call Plug('tpope/vim-repeat')
|
||||
call Plug('tpope/vim-rhubarb')
|
||||
call Plug('tpope/vim-sleuth')
|
||||
call Plug('tpope/vim-surround')
|
||||
call Plug('tpope/vim-unimpaired')
|
||||
|
||||
minpac#add('wincent/loupe')
|
||||
minpac#add('wincent/terminus')
|
||||
minpac#add('w0rp/ale')
|
||||
call Plug('wincent/loupe')
|
||||
call Plug('wincent/terminus')
|
||||
call Plug('w0rp/ale')
|
||||
|
||||
minpac#add('neoclide/coc.nvim', {branch: 'release'})
|
||||
call Plug('neoclide/coc.nvim', {'branch': 'release'})
|
||||
|
||||
minpac#add('vim-airline/vim-airline')
|
||||
minpac#add('vim-airline/vim-airline-themes')
|
||||
minpac#add('lambdalisue/battery.vim')
|
||||
call Plug('vim-airline/vim-airline')
|
||||
call Plug('vim-airline/vim-airline-themes')
|
||||
call Plug('lambdalisue/battery.vim')
|
||||
|
||||
minpac#add('alvan/vim-closetag')
|
||||
minpac#add('LaTeX-Box-Team/LaTeX-Box')
|
||||
minpac#add('vhda/verilog_systemverilog.vim')
|
||||
minpac#add('sheerun/vim-polyglot')
|
||||
call Plug('alvan/vim-closetag')
|
||||
call Plug('LaTeX-Box-Team/LaTeX-Box')
|
||||
call Plug('vhda/verilog_systemverilog.vim')
|
||||
call Plug('sheerun/vim-polyglot')
|
||||
|
||||
minpac#add('eipipuz/factor.vim')
|
||||
call Plug('eipipuz/factor.vim')
|
||||
|
||||
minpac#add('ehamberg/vim-cute-python')
|
||||
minpac#add('Glench/Vim-Jinja2-Syntax')
|
||||
minpac#add('tweekmonster/braceless.vim')
|
||||
call Plug('ehamberg/vim-cute-python')
|
||||
call Plug('Glench/Vim-Jinja2-Syntax')
|
||||
call Plug('tweekmonster/braceless.vim')
|
||||
|
||||
minpac#add('ternjs/tern_for_vim', {do: () => async#job#start(['npm', 'install'], {})})
|
||||
minpac#add('vito-c/jq.vim')
|
||||
call Plug('ternjs/tern_for_vim', {'do': {-> async#job#start(['npm', 'install'], {})}})
|
||||
call Plug('vito-c/jq.vim')
|
||||
|
||||
minpac#add('fladson/vim-kitty')
|
||||
call Plug('fladson/vim-kitty')
|
||||
|
||||
minpac#add('fpob/nette.vim')
|
||||
call Plug('fpob/nette.vim')
|
||||
|
||||
minpac#add('leafOfTree/vim-svelte-plugin')
|
||||
call Plug('leafOfTree/vim-svelte-plugin')
|
||||
|
||||
if executable('task')
|
||||
minpac#add('farseer90718/vim-taskwarrior')
|
||||
call Plug('farseer90718/vim-taskwarrior')
|
||||
endif
|
||||
|
||||
minpac#add('pedrohdz/vim-yaml-folds')
|
||||
call Plug('pedrohdz/vim-yaml-folds')
|
||||
|
||||
minpac#add('alx741/yesod.vim')
|
||||
minpac#add('pbrisbin/vim-syntax-shakespeare')
|
||||
call Plug('alx741/yesod.vim')
|
||||
call Plug('pbrisbin/vim-syntax-shakespeare')
|
||||
|
||||
if has('macunix')
|
||||
minpac#add('rizzatti/dash.vim')
|
||||
# We rename this plugin to make sure it loads AFTER vim-polyglot,
|
||||
# since it won't work properly if it's loaded first.
|
||||
minpac#add('itspriddle/vim-marked', {name: 'zzvim-marked'})
|
||||
call Plug('rizzatti/dash.vim')
|
||||
" We rename this plugin to make sure it loads AFTER vim-polyglot,
|
||||
" since it won't work properly if it's loaded first.
|
||||
call Plug('itspriddle/vim-marked', {'name': 'zzvim-marked'})
|
||||
endif
|
||||
|
||||
call PlugEnd()
|
||||
|
|
17
vimrc
17
vimrc
|
@ -1,13 +1,6 @@
|
|||
vim9script
|
||||
const xdg = {
|
||||
XDG_CONFIG_HOME: '~/.config',
|
||||
XDG_CACHE_HOME: '~/.cache',
|
||||
XDG_DATA_HOME: '~/.local/share',
|
||||
XDG_STATE_HOME: '~/.local/state',
|
||||
}
|
||||
for [key, default] in items(xdg)
|
||||
if !has_key(environ(), key)
|
||||
setenv(key, expand(default))
|
||||
for [s:var, s:value] in items({'XDG_CONFIG_HOME': '~/.config', 'XDG_CACHE_HOME': '~/.cache', 'XDG_DATA_HOME': '~/.local/share', 'XDG_STATE_HOME': '~/.local/state'})
|
||||
if (empty(eval('$' . s:var)))
|
||||
exec 'let $' . s:var . ' = expand(s:value)'
|
||||
endif
|
||||
endfor
|
||||
|
||||
|
@ -16,7 +9,7 @@ set viminfo+=n$XDG_STATE_HOME/vim/viminfo
|
|||
if exists('+packpath')
|
||||
set packpath^=$XDG_CONFIG_HOME/vim,$XDG_CACHE_HOME/vim
|
||||
endif
|
||||
g:netrw_home = $XDG_CACHE_HOME .. '/vim/netrw'
|
||||
let g:netrw_home = $XDG_CACHE_HOME . '/vim/netrw'
|
||||
|
||||
$MYVIMRC = $XDG_CONFIG_HOME .. '/vim/init.vim'
|
||||
let $MYVIMRC = $XDG_CONFIG_HOME . '/vim/init.vim'
|
||||
source $MYVIMRC
|
||||
|
|
Loading…
Reference in a new issue