Compare commits

..

3 Commits

Author SHA1 Message Date
github-actions[bot]
5aaa177756 chore: update pre-commit hooks (#86)
Co-authored-by: ivuorinen <11024+ivuorinen@users.noreply.github.com>
2025-03-03 08:32:57 +02:00
31a6ea351d Update linters.yml 2025-03-02 12:41:30 +02:00
333995c7f4 fix(config): vim config
Signed-off-by: Ismo Vuorinen <ismo@ivuorinen.net>
2025-02-28 17:08:06 +02:00
4 changed files with 66 additions and 187 deletions

View File

@@ -5,6 +5,8 @@ jobs:
linters: linters:
name: Linters name: Linters
runs-on: self-hosted runs-on: self-hosted
permissions:
contents: write
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
- name: GitHub Actions - name: GitHub Actions

3
.gitignore vendored
View File

@@ -24,6 +24,8 @@ config/nvim/spell/*
!config/nvim/spell/.gitkeep !config/nvim/spell/.gitkeep
config/git/local.d/* config/git/local.d/*
!config/git/local.d/.gitkeep !config/git/local.d/.gitkeep
config/vim/fzf
config/vim/plugged/*
config/zed/* config/zed/*
!config/zed/settings.json !config/zed/settings.json
config/zsh/.zcompdump config/zsh/.zcompdump
@@ -39,3 +41,4 @@ config/fish/fish_variables
**/exports-secret.fish **/exports-secret.fish
config/fish/completions/asdf.fish config/fish/completions/asdf.fish
config/vim/.netrwhist config/vim/.netrwhist
*.swp

View File

@@ -49,7 +49,7 @@ repos:
- id: actionlint - id: actionlint
- repo: https://github.com/renovatebot/pre-commit-hooks - repo: https://github.com/renovatebot/pre-commit-hooks
rev: 39.182.3 rev: 39.185.0
hooks: hooks:
- id: renovate-config-validator - id: renovate-config-validator

View File

@@ -1,12 +1,6 @@
" vim-bootstrap 2024-04-26 07:50:42 " This is my vimrc
"
" https://tlvince.com/vim-respect-xdg "
set directory=$XDG_CACHE_HOME/vim,~/,/tmp
set backupdir=$XDG_CACHE_HOME/vim,~/,/tmp
set viminfo+=n$XDG_CACHE_HOME/vim/viminfo
set runtimepath=$XDG_CONFIG_HOME/vim,$XDG_CONFIG_HOME/vim/after,$VIM,$VIMRUNTIME
let $MYVIMRC="$XDG_CONFIG_HOME/vim/vimrc"
"***************************************************************************** "*****************************************************************************
"" Vim-Plug core "" Vim-Plug core
"***************************************************************************** "*****************************************************************************
@@ -19,7 +13,7 @@ endif
let g:vim_bootstrap_langs = "go,html,javascript,lua,php,python,typescript" let g:vim_bootstrap_langs = "go,html,javascript,lua,php,python,typescript"
let g:vim_bootstrap_editor = "vim" " nvim or vim let g:vim_bootstrap_editor = "vim" " nvim or vim
let g:vim_bootstrap_theme = "material" let g:vim_bootstrap_theme = "minimalist"
let g:vim_bootstrap_frams = "vuejs" let g:vim_bootstrap_frams = "vuejs"
if !filereadable(vimplug_exists) if !filereadable(vimplug_exists)
@@ -38,15 +32,10 @@ endif
" Required: " Required:
call plug#begin(expand('$HOME/.config/vim/plugged')) call plug#begin(expand('$HOME/.config/vim/plugged'))
"*****************************************************************************
"" Plug install packages
"*****************************************************************************
Plug 'scrooloose/nerdtree' Plug 'scrooloose/nerdtree'
Plug 'jistr/vim-nerdtree-tabs' Plug 'jistr/vim-nerdtree-tabs'
Plug 'tpope/vim-commentary' Plug 'tpope/vim-commentary'
Plug 'tpope/vim-fugitive' Plug 'tpope/vim-fugitive'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter' Plug 'airblade/vim-gitgutter'
Plug 'vim-scripts/grep.vim' Plug 'vim-scripts/grep.vim'
Plug 'vim-scripts/CSApprox' Plug 'vim-scripts/CSApprox'
@@ -56,13 +45,13 @@ Plug 'dense-analysis/ale'
Plug 'Yggdroot/indentLine' Plug 'Yggdroot/indentLine'
Plug 'editor-bootstrap/vim-bootstrap-updater' Plug 'editor-bootstrap/vim-bootstrap-updater'
Plug 'tpope/vim-rhubarb' " required by fugitive to :GBrowse Plug 'tpope/vim-rhubarb' " required by fugitive to :GBrowse
Plug 'kaicataldo/material.vim' Plug 'dikiaap/minimalist'
Plug 'liuchengxu/vim-which-key'
if isdirectory('~/.config/vim/extra/fzf')
if isdirectory('~/.local/bin/fzf')
Plug '~/.local/bin/fzf' | Plug 'junegunn/fzf.vim' Plug '~/.local/bin/fzf' | Plug 'junegunn/fzf.vim'
else else
Plug 'junegunn/fzf', { 'dir': '~/.local/bin/fzf', 'do': './install --bin' } Plug 'junegunn/fzf', { 'dir': '~/.config/vim/fzf', 'do': './install --bin' }
Plug 'junegunn/fzf.vim' Plug 'junegunn/fzf.vim'
endif endif
let g:make = 'gmake' let g:make = 'gmake'
@@ -75,19 +64,10 @@ Plug 'Shougo/vimproc.vim', {'do': g:make}
Plug 'xolox/vim-misc' Plug 'xolox/vim-misc'
Plug 'xolox/vim-session' Plug 'xolox/vim-session'
"" Snippets
Plug 'SirVer/ultisnips'
Plug 'honza/vim-snippets'
"*****************************************************************************
"" Custom bundles
"*****************************************************************************
" go " go
"" Go Lang Bundle "" Go Lang Bundle
Plug 'fatih/vim-go', {'do': ':GoInstallBinaries'} Plug 'fatih/vim-go', {'do': ':GoInstallBinaries'}
" html " html
"" HTML Bundle "" HTML Bundle
Plug 'hail2u/vim-css3-syntax' Plug 'hail2u/vim-css3-syntax'
@@ -95,87 +75,80 @@ Plug 'gko/vim-coloresque'
Plug 'tpope/vim-haml' Plug 'tpope/vim-haml'
Plug 'mattn/emmet-vim' Plug 'mattn/emmet-vim'
" javascript " javascript
"" Javascript Bundle "" Javascript Bundle
Plug 'jelera/vim-javascript-syntax' Plug 'jelera/vim-javascript-syntax'
" lua " lua
"" Lua Bundle "" Lua Bundle
Plug 'xolox/vim-lua-ftplugin' Plug 'xolox/vim-lua-ftplugin'
Plug 'xolox/vim-lua-inspect' Plug 'xolox/vim-lua-inspect'
" php " php
"" PHP Bundle "" PHP Bundle
Plug 'phpactor/phpactor', {'for': 'php', 'do': 'composer install --no-dev -o'} Plug 'phpactor/phpactor', {'for': 'php', 'do': 'composer install --no-dev -o'}
Plug 'stephpy/vim-php-cs-fixer' Plug 'stephpy/vim-php-cs-fixer'
" python " python
"" Python Bundle "" Python Bundle
Plug 'davidhalter/jedi-vim' Plug 'davidhalter/jedi-vim'
Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'} Plug 'raimon49/requirements.txt.vim', {'for': 'requirements'}
" typescript " typescript
Plug 'leafgarland/typescript-vim' Plug 'leafgarland/typescript-vim'
Plug 'HerringtonDarkholme/yats.vim' Plug 'HerringtonDarkholme/yats.vim'
" vuejs " vuejs
Plug 'posva/vim-vue' Plug 'posva/vim-vue'
Plug 'leafOfTree/vim-vue-plugin' Plug 'leafOfTree/vim-vue-plugin'
"***************************************************************************** "*****************************************************************************
"***************************************************************************** "*****************************************************************************
"" Include user's extra bundle set nocompatible " disable compatibility mode with vi
if filereadable(expand("~/.config/vim/vimrc.local.bundles")) filetype off " disable filetype detection (but re-enable later, see below)
source ~/.config/vim/vimrc.local.bundles
endif set encoding=utf-8 " UTF-8
set number " Show line numbers
set relativenumber " Show relative line numbers
set laststatus=2 " Always show statusline (even with only single window)
set showmatch " Highlight matching brace
set visualbell " Use visual bell (no beeping)
set backspace=indent,eol,start " Backspace behaviour
set cindent " Use 'C' style program indenting
set cursorline " Highlight current line
set expandtab " Use spaces instead of tabs
set fileformats=unix,dos,mac
set ignorecase " Always case-insensitive
set incsearch " Searches for strings incrementally
set linespace=3
set modeline
set modelines=3
set mouse=a
set mousemodel=popup
set ruler " Show row and column ruler information
set scrolloff=5
set shiftwidth=4 " Number of auto-indent spaces
set smartcase " Enable smart-case search
set smartindent " Enable smart-indent
set smarttab " Enable smart-tabs
set softtabstop=4 " Number of spaces per Tab
set termguicolors
set undolevels=1000 " Number of undo levels
set wildmenu
call plug#end() call plug#end()
" Required: " Required:
filetype plugin indent on filetype plugin indent on
"*****************************************************************************
"" Basic Setup
"*****************************************************************************"
"" Encoding
set encoding=utf-8
set fileencoding=utf-8
set fileencodings=utf-8
set ttyfast
"" Fix backspace indent
set backspace=indent,eol,start
"" Tabs. May be overridden by autocmd rules
set tabstop=4
set softtabstop=0
set shiftwidth=4
set expandtab
"" Map leader to <space> "" Map leader to <space>
let mapleader=' ' let mapleader=' '
"" Enable hidden buffers "" Enable hidden buffers
set hidden set hidden
"" Searching
set hlsearch
set incsearch
set ignorecase
set smartcase
set fileformats=unix,dos,mac
if exists('$SHELL') if exists('$SHELL')
set shell=$SHELL set shell=$SHELL
else else
@@ -184,35 +157,20 @@ endif
" session management " session management
let g:session_directory = "~/.local/state/vim/session" let g:session_directory = "~/.local/state/vim/session"
let g:session_autoload = "no" let g:session_autoload = "yes"
let g:session_autosave = "yes" let g:session_autosave = "yes"
let g:session_command_aliases = 1 let g:session_command_aliases = 1
"*****************************************************************************
"" Visual Settings
"*****************************************************************************
syntax on syntax on
set ruler
set number
let no_buffers_menu=1
colorscheme material
" Better command line completion
set wildmenu
" mouse support
set mouse=a
set mousemodel=popup set mousemodel=popup
set t_Co=256 set t_Co=256
set guioptions=egmrti set guioptions=egmrti
set gfn=Monospace\ 13
if has("gui_running") if has("gui_running")
if has("gui_mac") || has("gui_macvim") if has("gui_mac") || has("gui_macvim")
set guifont=Menlo:h14 set macligatures
set guifont=JetBrains\ Mono:h14
set transparency=7 set transparency=7
endif endif
else else
@@ -224,7 +182,6 @@ else
let g:indentLine_char = '┆' let g:indentLine_char = '┆'
let g:indentLine_faster = 1 let g:indentLine_faster = 1
if $COLORTERM == 'gnome-terminal' if $COLORTERM == 'gnome-terminal'
set term=gnome-256color set term=gnome-256color
else else
@@ -235,30 +192,15 @@ else
endif endif
if &term =~ '256color' if &term =~ '256color'
set t_ut= set t_ut=
endif endif
"" Disable the blinking cursor.
set gcr=a:blinkon0
set scrolloff=10
"" Status bar
set laststatus=2
"" Use modeline overrides
set modeline
set modelines=10
set title set title
set titleold="Terminal" set titleold="Terminal"
set titlestring=%F set titlestring=%F
set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L,\ col\ %c)\ set statusline=%F%m%r%h%w%=(%{&ff}/%Y)\ (line\ %l\/%L)|
" Search mappings: These will make it so that going to the next one in a " Search mappings: These will make it so that going to the next one in a
" search will center on the line it's found in. " search will center on the line it's found in.
@@ -270,12 +212,13 @@ if exists("*fugitive#statusline")
endif endif
" vim-airline " vim-airline
let g:airline_theme = 'powerlineish'
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#ale#enabled = 1 let g:airline#extensions#ale#enabled = 1
let g:airline#extensions#branch#enabled = 1
let g:airline#extensions#tabline#enabled = 1 let g:airline#extensions#tabline#enabled = 1
let g:airline#extensions#tagbar#enabled = 1 let g:airline#extensions#tagbar#enabled = 1
let g:airline_powerline_fonts = 1
let g:airline_skip_empty_sections = 1 let g:airline_skip_empty_sections = 1
let g:airline_theme = 'minimalist'
"***************************************************************************** "*****************************************************************************
"" Abbreviations "" Abbreviations
@@ -294,7 +237,7 @@ cnoreabbrev Qall qall
"" NERDTree configuration "" NERDTree configuration
let g:NERDTreeChDirMode=2 let g:NERDTreeChDirMode=2
let g:NERDTreeIgnore=['node_modules','vendor','\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__'] let g:NERDTreeIgnore=['node_modules', 'vendor', '\.rbc$', '\~$', '\.pyc$', '\.db$', '\.sqlite$', '__pycache__']
let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$'] let g:NERDTreeSortOrder=['^__\.py$', '\/$', '*', '\.swp$', '\.bak$', '\~$']
let g:NERDTreeShowBookmarks=1 let g:NERDTreeShowBookmarks=1
let g:nerdtree_tabs_focus_on_files=1 let g:nerdtree_tabs_focus_on_files=1
@@ -302,7 +245,7 @@ let g:NERDTreeMapOpenInTabSilent = '<RightMouse>'
let g:NERDTreeWinSize = 50 let g:NERDTreeWinSize = 50
set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite,*node_modules/,*vendor/ set wildignore+=*/tmp/*,*.so,*.swp,*.zip,*.pyc,*.db,*.sqlite,*node_modules/,*vendor/
nnoremap <silent> <F2> :NERDTreeFind<CR> nnoremap <silent> <F2> :NERDTreeFind<CR>
nnoremap <silent> <F3> :NERDTreeToggle<CR> nnoremap <silent> <leader>q :NERDTreeToggle<CR>
" grep.vim " grep.vim
nnoremap <silent> <leader>f :Rgrep<CR> nnoremap <silent> <leader>f :Rgrep<CR>
@@ -313,16 +256,21 @@ let Grep_Skip_Dirs = '.git node_modules vendor plugged'
" terminal emulation " terminal emulation
nnoremap <silent> <leader>sh :terminal<CR> nnoremap <silent> <leader>sh :terminal<CR>
" vim-which-key config
nnoremap <silent> <leader> :WhichKey '<Space>'<CR>
set timeoutlen=500 " By default timeoutlen=1000 (ms)
"***************************************************************************** "*****************************************************************************
"" Commands "" Commands
"***************************************************************************** "*****************************************************************************
" remove trailing whitespaces " remove trailing whitespaces
command! FixWhitespace :%s/\s\+$//e command! FixWhitespace :%s/\s\+$//e
"***************************************************************************** "*****************************************************************************
"" Functions "" Functions
"***************************************************************************** "*****************************************************************************
if !exists('*s:setupWrapping') if !exists('*s:setupWrapping')
function s:setupWrapping() function s:setupWrapping()
set wrap set wrap
@@ -334,6 +282,7 @@ endif
"***************************************************************************** "*****************************************************************************
"" Autocmd Rules "" Autocmd Rules
"***************************************************************************** "*****************************************************************************
"" The PC is fast enough, do syntax highlight syncing from start unless 200 lines "" The PC is fast enough, do syntax highlight syncing from start unless 200 lines
augroup vimrc-sync-fromstart augroup vimrc-sync-fromstart
autocmd! autocmd!
@@ -343,7 +292,7 @@ augroup END
"" Remember cursor position "" Remember cursor position
augroup vimrc-remember-cursor-position augroup vimrc-remember-cursor-position
autocmd! autocmd!
autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif " autocmd BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
augroup END augroup END
"" txt "" txt
@@ -404,12 +353,6 @@ set wildmode=list:longest,list:full
set wildignore+=*.o,*.obj,.git,*.rbc,*.pyc,__pycache__,vendor set wildignore+=*.o,*.obj,.git,*.rbc,*.pyc,__pycache__,vendor
let $FZF_DEFAULT_COMMAND = "find * -path '*/\.*' -prune -o -path 'node_modules/**' -prune -o -path 'target/**' -prune -o -path 'vendor/**' -prune -o -path 'dist/**' -prune -o -type f -print -o -type l -print 2> /dev/null" let $FZF_DEFAULT_COMMAND = "find * -path '*/\.*' -prune -o -path 'node_modules/**' -prune -o -path 'target/**' -prune -o -path 'vendor/**' -prune -o -path 'dist/**' -prune -o -type f -print -o -type l -print 2> /dev/null"
" The Silver Searcher
if executable('ag')
let $FZF_DEFAULT_COMMAND = 'ag --hidden --ignore .git -g ""'
set grepprg=ag\ --nogroup\ --nocolor
endif
" ripgrep " ripgrep
if executable('rg') if executable('rg')
let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"' let $FZF_DEFAULT_COMMAND = 'rg --files --hidden --follow --glob "!.git/*"'
@@ -423,12 +366,6 @@ nnoremap <silent> <leader>e :FZF -m<CR>
"Recovery commands from history through FZF "Recovery commands from history through FZF
nmap <leader>y :History:<CR> nmap <leader>y :History:<CR>
" snippets
let g:UltiSnipsExpandTrigger="<tab>"
let g:UltiSnipsJumpForwardTrigger="<tab>"
let g:UltiSnipsJumpBackwardTrigger="<c-b>"
let g:UltiSnipsEditSplit="vertical"
" ale " ale
let g:ale_linters = {} let g:ale_linters = {}
@@ -455,6 +392,7 @@ if has('macunix')
" pbcopy for OSX copy/paste " pbcopy for OSX copy/paste
vmap <C-x> :!pbcopy<CR> vmap <C-x> :!pbcopy<CR>
vmap <C-c> :w !pbcopy<CR><CR> vmap <C-c> :w !pbcopy<CR><CR>
vmap <C-v> :!pbpaste<CR>
endif endif
"" Buffer nav "" Buffer nav
@@ -554,15 +492,12 @@ augroup go
augroup END augroup END
" ale " ale
:call extend(g:ale_linters, { :call extend(g:ale_linters, {"go": [ 'golint', 'go vet' ]})
\"go": ['golint', 'go vet'], })
" html " html
" for html files, 2 spaces " for html files, 2 spaces
autocmd Filetype html setlocal ts=2 sw=2 expandtab autocmd Filetype html setlocal ts=2 sw=2 expandtab
" javascript " javascript
let g:javascript_enable_domhtmlcss = 1 let g:javascript_enable_domhtmlcss = 1
@@ -572,10 +507,6 @@ augroup vimrc-javascript
autocmd FileType javascript setl tabstop=4|setl shiftwidth=4|setl expandtab softtabstop=4 autocmd FileType javascript setl tabstop=4|setl shiftwidth=4|setl expandtab softtabstop=4
augroup END augroup END
" lua
" php " php
" Phpactor plugin " Phpactor plugin
" Include use statement " Include use statement
@@ -607,10 +538,7 @@ vmap <silent><Leader>em :<C-U>call phpactor#ExtractMethod()<CR>
" vim-python " vim-python
augroup vimrc-python augroup vimrc-python
autocmd! autocmd!
autocmd FileType python setlocal expandtab autocmd FileType python setlocal expandtab shiftwidth=4 tabstop=8 colorcolumn=79 formatoptions+=croq softtabstop=4 cinwords=if,elif,else,for,while,try,except,finally,def,class,with
\ shiftwidth=4 tabstop=8 colorcolumn=79
\ formatoptions+=croq softtabstop=4
\ cinwords=if,elif,else,for,while,try,except,finally,def,class,with
augroup END augroup END
" jedi-vim " jedi-vim
@@ -625,71 +553,17 @@ let g:jedi#completions_command = "<C-Space>"
let g:jedi#smart_auto_mappings = 0 let g:jedi#smart_auto_mappings = 0
" ale " ale
:call extend(g:ale_linters, { :call extend(g:ale_linters, { 'python': [ 'flake8' ] })
\'python': ['flake8'], })
" vim-airline
let g:airline#extensions#virtualenv#enabled = 1
" Syntax highlight " Syntax highlight
let python_highlight_all = 1 let python_highlight_all = 1
" typescript " typescript
let g:yats_host_keyword = 1 let g:yats_host_keyword = 1
" vuejs " vuejs
" vim vue " vim vue
let g:vue_disable_pre_processors=1 let g:vue_disable_pre_processors=1
" vim vue plugin " vim vue plugin
let g:vim_vue_plugin_load_full_syntax = 1 let g:vim_vue_plugin_load_full_syntax = 1
"*****************************************************************************
"*****************************************************************************
"" Include user's local vim config
if filereadable(expand("~/.config/vimrc.local"))
source ~/.config/vimrc.local
endif
"*****************************************************************************
"" Convenience variables
"*****************************************************************************
" vim-airline
if !exists('g:airline_symbols')
let g:airline_symbols = {}
endif
if !exists('g:airline_powerline_fonts')
let g:airline#extensions#tabline#left_sep = ' '
let g:airline#extensions#tabline#left_alt_sep = '|'
let g:airline_left_sep = '▶'
let g:airline_left_alt_sep = '»'
let g:airline_right_sep = '◀'
let g:airline_right_alt_sep = '«'
let g:airline#extensions#branch#prefix = '⤴' "➔, ➥, ⎇
let g:airline#extensions#readonly#symbol = '⊘'
let g:airline#extensions#linecolumn#prefix = '¶'
let g:airline#extensions#paste#symbol = 'ρ'
let g:airline_symbols.linenr = '␊'
let g:airline_symbols.branch = '⎇'
let g:airline_symbols.paste = 'ρ'
let g:airline_symbols.paste = 'Þ'
let g:airline_symbols.paste = '∥'
let g:airline_symbols.whitespace = 'Ξ'
else
let g:airline#extensions#tabline#left_sep = ''
let g:airline#extensions#tabline#left_alt_sep = ''
" powerline symbols
let g:airline_left_sep = ''
let g:airline_left_alt_sep = ''
let g:airline_right_sep = ''
let g:airline_right_alt_sep = ''
let g:airline_symbols.branch = ''
let g:airline_symbols.readonly = ''
let g:airline_symbols.linenr = ''
endif