Mercurial > dotfiles
changeset 506:45245f87b9bf
Merged changes.
author | Ludovic Chabant <ludovic@chabant.com> |
---|---|
date | Fri, 12 Nov 2021 11:56:14 -0800 |
parents | ea3aeb55fca2 (diff) c19fd52542ba (current diff) |
children | d78f61fb8414 |
files | install.cfg |
diffstat | 9 files changed, 109 insertions(+), 48 deletions(-) [+] |
line wrap: on
line diff
--- a/git/gitconfig Sat Oct 10 17:08:57 2020 -0700 +++ b/git/gitconfig Fri Nov 12 11:56:14 2021 -0800 @@ -1,3 +1,6 @@ +[core] + editor = vim + [user] name = Ludovic Chabant email = ludovic@chabant.com
--- a/hgrc/hgrc Sat Oct 10 17:08:57 2020 -0700 +++ b/hgrc/hgrc Fri Nov 12 11:56:14 2021 -0800 @@ -20,7 +20,6 @@ rebase = schemes = shelve = -strip = [alias] glog = log -G
--- a/install.cfg Sat Oct 10 17:08:57 2020 -0700 +++ b/install.cfg Fri Nov 12 11:56:14 2021 -0800 @@ -57,16 +57,19 @@ [wintools] 7zip = consolez = +discord = fd = +firefox = fzf = git = -mercurial = 32bit +mercurial = 64bit +notepadplusplus = 64bit openssh = putty = ripgrep = sysinternals = universal-ctags = -vim = +vim-nightly = [mactools] @@ -75,8 +78,10 @@ cscope = ctags = diff-so-fancy = +discord = fd = fish = +firefox = fzf = git = global = @@ -92,6 +97,6 @@ tldr = tmux = urlview = -vim = +vim-nightly = weechat = z =
--- a/install.py Sat Oct 10 17:08:57 2020 -0700 +++ b/install.py Fri Nov 12 11:56:14 2021 -0800 @@ -191,6 +191,16 @@ 'source %s' % nixslash(_p('vim', 'vimrc')) ]) + # Create a gvimrc file mostly to fix a bug with Scoop, which + # installs a _gvimrc in the base runtime path, and it can mess + # up colors and settings. + gvimrc_path = '~/.gvimrc' + if is_windows: + gvimrc_path = '~/_gvimrc' + writelines(gvimrc_path, [ + 'source %s' % nixslash(_p('vim', 'gvimrc')) + ]) + _install_vim_bundle(cfg, 'vimbundles', _p('vim', 'bundle'), force) _install_vim_bundle(cfg, 'vimbundles:local', _p('vim', 'local'), force) @@ -269,6 +279,7 @@ def install_universal_ctags(): # On Windows, u-ctags has a bug where it outputs double-backslashes. if is_windows: + ensure_dir('~/ctags.d') writelines('~/ctags.d/global.ctags', [ '--output-format=e-ctags' ])
--- a/vim/autoload/ludo.vim Sat Oct 10 17:08:57 2020 -0700 +++ b/vim/autoload/ludo.vim Fri Nov 12 11:56:14 2021 -0800 @@ -45,6 +45,14 @@ echohl None endfunction +" Returns whether a plugin file exists in the runtime path. +function! ludo#has_plugin(plugname, ...) abort + let l:dirname = 'plugin/' + if a:0 && a:1 + let l:dirname = 'autoload/' + endif + return globpath(&runtimepath, l:dirname.a:plugname.'.vim') !=# '' +endfunction " Loads `pathogenrc` files in each bundle directory and, if found, " builds an exclude list based on the glob patterns found in them. @@ -65,26 +73,40 @@ if line[0] == '#' continue endif - + + if strcharpart(line, 0, 4) == "gui:" + if !has('gui') + call ludo#trace("Ignoring gui-only line: ".line) + continue + else + let line = line[4:] + endif + endif + if strcharpart(line, 0, 6) == "nogui:" + if has('gui') + call ludo#trace("Ignoring terminal-only line: ".line) + continue + else + let line = line[6:] + endif + endif + + let l:add_to = l:included + let l:remove_from = l:excluded if line[0] == '-' - let l:excls = glob(bundle_dir.'/'.line[1:], 1, 1) - for excl in l:excls - let l:idx = index(l:included, excl) - if l:idx >= 0 - call remove(l:included, l:idx) - endif - call add(l:excluded, excl) - endfor - else - let l:incls = glob(bundle_dir.'/'.line, 1, 1) - for incl in l:incls - let l:idx = index(l:excluded, incl) - if l:idx >= 0 - call remove(l:excluded, l:idx) - endif - call add(l:included, incl) - endfor + let l:add_to = l:excluded + let l:remove_from = l:included + let line = line[1:] endif + + let l:incls = glob(bundle_dir.'/'.line, 1, 1) + for incl in l:incls + let l:idx = index(l:remove_from, incl) + if l:idx >= 0 + call remove(l:remove_from, l:idx) + endif + call add(l:add_to, incl) + endfor endfor for excl in l:excluded @@ -170,3 +192,13 @@ endfor execute ':'.string(l:tagidx).'tag '.l:tag endfunction + +function! ludo#build_vs_or_ue() abort + if !empty(get(g:, 'unreal_branch_dir', '')) + UnrealBuild + elseif !empty(get(g: 'vimcrosoft_current_sln', '')) + VimcrosoftBuildActiveProject + else + call ludo#warn("No VS or UE project active") + endif +endfunction
--- a/vim/bundle.pathogenrc Sat Oct 10 17:08:57 2020 -0700 +++ b/vim/bundle.pathogenrc Fri Nov 12 11:56:14 2021 -0800 @@ -0,0 +1,2 @@ +nogui:-pythonmode +nogui:-python-pep8-indent
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/vim/gvimrc Fri Nov 12 11:56:14 2021 -0800 @@ -0,0 +1,15 @@ +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +" +" Ludovic Chabant's ~/.gvimrc +" +" http://ludovic.chabant.com +" +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +" Set a variable that says we already sourced this file, for those few +" settings we don't want to re-apply. +if exists('g:sourced_gvimrc') + let g:resourcing_gvimrc = 1 +endif +let g:sourced_gvimrc = 1 +
--- a/vim/local.pathogenrc Sat Oct 10 17:08:57 2020 -0700 +++ b/vim/local.pathogenrc Fri Nov 12 11:56:14 2021 -0800 @@ -0,0 +1,1 @@ +nogui:-*
--- a/vim/vimrc Sat Oct 10 17:08:57 2020 -0700 +++ b/vim/vimrc Fri Nov 12 11:56:14 2021 -0800 @@ -31,7 +31,11 @@ " Disable some plugins. let g:pathogen_disabled = get(g:, 'pathogen_disabled', []) -call ludo#setup_pathogen([ludo#localpath('bundle'), ludo#localpath('local')]) +let s:bundles = [ludo#localpath('bundle')] +if isdirectory(ludo#localpath('local')) + call add(s:bundles, ludo#localpath('local')) +endif +call ludo#setup_pathogen(s:bundles) " Load pathogen. runtime bundle/pathogen/autoload/pathogen.vim @@ -54,14 +58,6 @@ endif endif -function! s:HasPlugin(plugname, ...) abort - let l:dirname = 'plugin/' - if a:0 && a:1 - let l:dirname = 'autoload/' - endif - return globpath(&runtimepath, l:dirname.a:plugname.'.vim') !=# '' -endfunction - " }}} " General Settings {{{ @@ -287,11 +283,11 @@ " Use PyMatch to go faster. if (has('python3') || has('python')) - if s:HasPlugin('ctrlp-py-matcher') + if ludo#has_plugin('ctrlp-py-matcher') let g:ctrlp_match_func = {'match': 'pymatcher#PyMatch'} let g:ctrlp_max_files = 0 let g:ctrlp_lazy_update = 350 - elseif s:HasPlugin('cpsm', 1) + elseif ludo#has_plugin('cpsm', 1) let g:ctrlp_match_func = {'match': 'cpsm#CtrlPMatch'} let g:ctrlp_max_files = 0 let g:ctrlp_lazy_update = 350 @@ -456,7 +452,7 @@ \ }, \} -if s:HasPlugin('fugitive') +if ludo#has_plugin('fugitive') function! _LightlineFugitive() return fugitive#head() endfunction @@ -465,7 +461,7 @@ endfunction endif -if s:HasPlugin('lawrencium') +if ludo#has_plugin('lawrencium') function! _LightlineLawrencium() return lawrencium#statusline() endfunction @@ -487,7 +483,7 @@ endif endfunction -if s:HasPlugin('gutentags') +if ludo#has_plugin('gutentags') function! _LightlineGutentags() return gutentags#statusline('', '', '♨') endfunction @@ -496,7 +492,7 @@ endfunction endif -if s:HasPlugin('syntastic') +if ludo#has_plugin('syntastic') function! _LightlineLinter() return SyntasticStatuslineFlag() endfunction @@ -515,7 +511,7 @@ endfunction endif -if s:HasPlugin('youcompleteme') +if ludo#has_plugin('youcompleteme') function! _LightlineYcmErrors() let l:cnt = youcompleteme#GetErrorCount() return l:cnt > 0 ? string(l:cnt) : '' @@ -734,7 +730,7 @@ nnoremap N Nzvzz " YCM mappings. -if s:HasPlugin('youcompleteme') +if ludo#has_plugin('youcompleteme') augroup VimRC_YouCompleteMe autocmd! autocmd FileType cpp nnoremap <Leader>jj :YcmCompleter GoToImprecise<cr>zv @@ -748,7 +744,7 @@ endif " OmniSharp mappings -if s:HasPlugin('OmniSharp') +if ludo#has_plugin('OmniSharp') augroup VimRC_OmniSharp autocmd! autocmd FileType cs setlocal omnifunc=OmniSharp#Complete @@ -788,7 +784,7 @@ nnoremap <leader>cd :ProjectRootCD<cr> " Ctrl-P mappings. -if s:HasPlugin('ctrlp') +if ludo#has_plugin('ctrlp') nnoremap <silent> <C-p> :CtrlP<cr> nnoremap <silent> <C-o> :CtrlPBuffer<cr> nnoremap <silent> <C-u> :CtrlPTag<cr> @@ -798,7 +794,7 @@ endif " FZF mappings. -if s:HasPlugin('fzf') +if ludo#has_plugin('fzf') if exists('*fzf#run') nnoremap <silent> <C-p> :Files<cr> nnoremap <silent> <C-o> :Buffers<cr> @@ -816,7 +812,7 @@ endif " LeaderF mappings. -if s:HasPlugin('leaderf') +if ludo#has_plugin('leaderf') let g:Lf_ShortcutF = '<C-p>' let g:Lf_ShortcutB = '<C-o>' nnoremap <silent> <C-p> :LeaderfFile<cr> @@ -832,11 +828,8 @@ let g:Lf_StlSeparator = { 'left': '', 'right': '' } endif -" Vimcrosoft mappings. -if s:HasPlugin('vimcrosoft') - nnoremap <F7> :VimcrosoftBuildActiveProject<cr> - nnoremap <F8> :VimcrosoftBuildSln<cr> -endif +" Vimcrosoft/UE mappings. +nnoremap <F7> :call ludo#build_vs_or_ue()<cr> " }}}