From b78f7df4a95da93bdf5da3100074c413e2167b5f Mon Sep 17 00:00:00 2001 From: Diego Marinho Date: Sat, 4 Apr 2026 18:25:46 +1100 Subject: [PATCH] fix: harden vim template startup checks --- .github/workflows/smoke-checks.yml | 8 ++- run_commands/.my_vimrc | 83 +++++++++++++++++------------- run_commands/my_vimrc | 83 +++++++++++++++++------------- 3 files changed, 101 insertions(+), 73 deletions(-) diff --git a/.github/workflows/smoke-checks.yml b/.github/workflows/smoke-checks.yml index 898a50b..e112ac7 100644 --- a/.github/workflows/smoke-checks.yml +++ b/.github/workflows/smoke-checks.yml @@ -15,7 +15,7 @@ jobs: uses: actions/checkout@v4 - name: Install dependencies - run: sudo apt-get update && sudo apt-get install -y zsh tmux neovim lua5.4 python3 fd-find bat + run: sudo apt-get update && sudo apt-get install -y vim zsh tmux neovim lua5.4 python3 fd-find bat - name: Prepare tmux powerline placeholder run: mkdir -p "$HOME/.powerline/powerline/bindings/tmux" && touch "$HOME/.powerline/powerline/bindings/tmux/powerline.conf" @@ -32,6 +32,12 @@ jobs: - name: Validate Neovim template syntax run: lua -e "assert(loadfile('run_commands/my_nvim_init.lua'))" + - name: Validate Vim template startup + run: vim -Nu run_commands/my_vimrc -n -es +qa! + + - name: Validate hidden Vim template startup + run: vim -Nu run_commands/.my_vimrc -n -es +qa! + - name: Validate Makefile targets run: make help diff --git a/run_commands/.my_vimrc b/run_commands/.my_vimrc index 2d85a69..b881337 100755 --- a/run_commands/.my_vimrc +++ b/run_commands/.my_vimrc @@ -3,38 +3,40 @@ set nocompatible filetype off set rtp+=~/.vim/bundle/Vundle.vim -call vundle#begin() -Plugin 'derekwyatt/vim-scala' -Plugin 'JuliaLang/julia-vim' -Plugin 'jmcantrell/vim-virtualenv' -Plugin 'edkolev/tmuxline.vim' -Plugin 'sjl/gundo.vim' -Plugin 'bling/vim-bufferline' -Plugin 'airblade/vim-gitgutter.git' -Plugin 'godlygeek/csapprox' -Plugin 'altercation/vim-colors-solarized.git' -Plugin 'majutsushi/tagbar' -Plugin 'vim-scripts/supertab.git' -Plugin 'tomtom/tcomment_vim' -Plugin 'Raimondi/delimitMate' -Plugin 'haya14busa/incsearch.vim' -Plugin 'easymotion/vim-easymotion' -Plugin 'kien/ctrlp.vim' -Plugin 'scrooloose/nerdtree' -Plugin 'bling/vim-airline' -Plugin 'vim-airline/vim-airline-themes' -Plugin 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'} -Plugin 'chrisbra/csv.vim' -Plugin 'scrooloose/syntastic' -Plugin 'davidhalter/jedi-vim' -Plugin 'itchyny/lightline.vim' -Plugin 'itchyny/landscape.vim' -Plugin 'python-rope/rope' -Plugin 'tpope/vim-fugitive' -Plugin 'git://git.wincent.com/command-t.git' -Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} -Plugin 'terryma/vim-multiple-cursors' -call vundle#end() +if exists('*vundle#begin') + call vundle#begin() + Plugin 'derekwyatt/vim-scala' + Plugin 'JuliaLang/julia-vim' + Plugin 'jmcantrell/vim-virtualenv' + Plugin 'edkolev/tmuxline.vim' + Plugin 'sjl/gundo.vim' + Plugin 'bling/vim-bufferline' + Plugin 'airblade/vim-gitgutter.git' + Plugin 'godlygeek/csapprox' + Plugin 'altercation/vim-colors-solarized.git' + Plugin 'majutsushi/tagbar' + Plugin 'vim-scripts/supertab.git' + Plugin 'tomtom/tcomment_vim' + Plugin 'Raimondi/delimitMate' + Plugin 'haya14busa/incsearch.vim' + Plugin 'easymotion/vim-easymotion' + Plugin 'kien/ctrlp.vim' + Plugin 'scrooloose/nerdtree' + Plugin 'bling/vim-airline' + Plugin 'vim-airline/vim-airline-themes' + Plugin 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'} + Plugin 'chrisbra/csv.vim' + Plugin 'scrooloose/syntastic' + Plugin 'davidhalter/jedi-vim' + Plugin 'itchyny/lightline.vim' + Plugin 'itchyny/landscape.vim' + Plugin 'python-rope/rope' + Plugin 'tpope/vim-fugitive' + Plugin 'git://git.wincent.com/command-t.git' + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + Plugin 'terryma/vim-multiple-cursors' + call vundle#end() +endif filetype plugin indent on " Brief help @@ -48,7 +50,9 @@ filetype plugin indent on " ---------------------------------------------------------------------------- " Pathogen -execute pathogen#infect() +if exists('*pathogen#infect') + execute pathogen#infect() +endif " Jedi-Vim let g:jedi#auto_initialization = 1 @@ -81,7 +85,9 @@ let g:airline#extensions#tmuxline#enabled = 0 set laststatus=2 set statusline=%<%f\ " Filename set statusline+=%w%h%m%r " Options -set statusline+=%{fugitive#statusline()} " Git Hotness +if exists('*fugitive#statusline') + set statusline+=%{fugitive#statusline()} " Git Hotness +endif set statusline+=\ [%{&ff}/%Y] " filetype set statusline+=\ [%{getcwd()}] " current dir @@ -139,7 +145,9 @@ let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 let g:syntastic_python_checkers = ['pyflakes', 'flake8'] set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} +if exists('*SyntasticStatuslineFlag') + set statusline+=%{SyntasticStatuslineFlag()} +endif set statusline+=%* " Color Theme @@ -170,10 +178,13 @@ nnoremap h nnoremap l " Solarized Colors -colorscheme solarized let g:solarized_termtrans=1 let g:solarized_termcolors=256 let g:solarized_contrast="normal" let g:solarized_visibility="normal" set background=dark +silent! colorscheme solarized +if !exists('g:colors_name') || g:colors_name !=# 'solarized' + silent! colorscheme torte +endif let g:CSApprox_loaded = 1 diff --git a/run_commands/my_vimrc b/run_commands/my_vimrc index 35d77b8..b7744d4 100755 --- a/run_commands/my_vimrc +++ b/run_commands/my_vimrc @@ -3,38 +3,40 @@ set nocompatible filetype off set rtp+=~/.vim/bundle/Vundle.vim -call vundle#begin() -Plugin 'derekwyatt/vim-scala' -Plugin 'JuliaLang/julia-vim' -Plugin 'jmcantrell/vim-virtualenv' -Plugin 'edkolev/tmuxline.vim' -Plugin 'sjl/gundo.vim' -Plugin 'bling/vim-bufferline' -Plugin 'airblade/vim-gitgutter.git' -Plugin 'godlygeek/csapprox' -Plugin 'altercation/vim-colors-solarized.git' -Plugin 'majutsushi/tagbar' -Plugin 'vim-scripts/supertab.git' -Plugin 'tomtom/tcomment_vim' -Plugin 'Raimondi/delimitMate' -Plugin 'haya14busa/incsearch.vim' -Plugin 'easymotion/vim-easymotion' -Plugin 'kien/ctrlp.vim' -Plugin 'scrooloose/nerdtree' -Plugin 'vim-airline/vim-airline-themes' -"FIXME: Problems with Calalina MacOs -"Plugin 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'} -Plugin 'chrisbra/csv.vim' -Plugin 'scrooloose/syntastic' -Plugin 'davidhalter/jedi-vim' -Plugin 'itchyny/lightline.vim' -Plugin 'itchyny/landscape.vim' -Plugin 'python-rope/rope' -Plugin 'tpope/vim-fugitive' -Plugin 'git://git.wincent.com/command-t.git' -Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} -Plugin 'terryma/vim-multiple-cursors' -call vundle#end() +if exists('*vundle#begin') + call vundle#begin() + Plugin 'derekwyatt/vim-scala' + Plugin 'JuliaLang/julia-vim' + Plugin 'jmcantrell/vim-virtualenv' + Plugin 'edkolev/tmuxline.vim' + Plugin 'sjl/gundo.vim' + Plugin 'bling/vim-bufferline' + Plugin 'airblade/vim-gitgutter.git' + Plugin 'godlygeek/csapprox' + Plugin 'altercation/vim-colors-solarized.git' + Plugin 'majutsushi/tagbar' + Plugin 'vim-scripts/supertab.git' + Plugin 'tomtom/tcomment_vim' + Plugin 'Raimondi/delimitMate' + Plugin 'haya14busa/incsearch.vim' + Plugin 'easymotion/vim-easymotion' + Plugin 'kien/ctrlp.vim' + Plugin 'scrooloose/nerdtree' + Plugin 'vim-airline/vim-airline-themes' + "FIXME: Problems with Calalina MacOs + "Plugin 'powerline/powerline', {'rtp': 'powerline/bindings/vim/'} + Plugin 'chrisbra/csv.vim' + Plugin 'scrooloose/syntastic' + Plugin 'davidhalter/jedi-vim' + Plugin 'itchyny/lightline.vim' + Plugin 'itchyny/landscape.vim' + Plugin 'python-rope/rope' + Plugin 'tpope/vim-fugitive' + Plugin 'git://git.wincent.com/command-t.git' + Plugin 'rstacruz/sparkup', {'rtp': 'vim/'} + Plugin 'terryma/vim-multiple-cursors' + call vundle#end() +endif filetype plugin indent on " Brief help @@ -48,7 +50,9 @@ filetype plugin indent on " ---------------------------------------------------------------------------- " Pathogen -execute pathogen#infect() +if exists('*pathogen#infect') + execute pathogen#infect() +endif " Jedi-Vim let g:jedi#auto_initialization = 1 @@ -81,7 +85,9 @@ let g:airline#extensions#tmuxline#enabled = 0 set laststatus=2 set statusline=%<%f\ " Filename set statusline+=%w%h%m%r " Options -set statusline+=%{fugitive#statusline()} " Git Hotness +if exists('*fugitive#statusline') + set statusline+=%{fugitive#statusline()} " Git Hotness +endif set statusline+=\ [%{&ff}/%Y] " filetype set statusline+=\ [%{getcwd()}] " current dir @@ -138,7 +144,9 @@ let g:syntastic_check_on_open = 1 let g:syntastic_check_on_wq = 0 let g:syntastic_python_checkers = ['pyflakes', 'flake8'] set statusline+=%#warningmsg# -set statusline+=%{SyntasticStatuslineFlag()} +if exists('*SyntasticStatuslineFlag') + set statusline+=%{SyntasticStatuslineFlag()} +endif set statusline+=%* " Color Theme @@ -174,7 +182,10 @@ let g:solarized_termtrans=1 let g:solarized_termcolors=256 let g:solarized_contrast="normal" let g:solarized_visibility="normal" -colorscheme solarized +silent! colorscheme solarized +if !exists('g:colors_name') || g:colors_name !=# 'solarized' + silent! colorscheme torte +endif let g:CSApprox_loaded = 1 " Highligh Line and Column