summaryrefslogtreecommitdiff
path: root/_config
diff options
context:
space:
mode:
authorUEDA Naoaki <n.ueda@socialdog.jp>2024-07-29 00:58:34 +0900
committerUEDA Naoaki <n.ueda@socialdog.jp>2024-07-29 00:58:34 +0900
commiteb061c6507c527723cffec3aca5b9556e9e2d5cf (patch)
tree172ae729e14f009f1fd0b49a35a8d5adde448ae7 /_config
parent4bd722d5e9ee2fb23b513514090c4bc5457f2bf5 (diff)
downloadvimrc-eb061c6507c527723cffec3aca5b9556e9e2d5cf.tar.gz
vimrc-eb061c6507c527723cffec3aca5b9556e9e2d5cf.tar.bz2
vimrc-eb061c6507c527723cffec3aca5b9556e9e2d5cf.zip
Modify lightline config to show the filepath
Diffstat (limited to '_config')
-rw-r--r--_config/101-lightline.vim12
-rw-r--r--_config/113-auto-touch-on-save.vim2
2 files changed, 13 insertions, 1 deletions
diff --git a/_config/101-lightline.vim b/_config/101-lightline.vim
index dcee2e2..4e8a8c3 100644
--- a/_config/101-lightline.vim
+++ b/_config/101-lightline.vim
@@ -17,7 +17,8 @@ let g:lightline = {
\ 'linter_errors': 'error'
\ },
\ 'component_function': {
-\ 'gitbranch': 'FugitiveHead'
+\ 'gitbranch': 'FugitiveHead',
+\ 'filename': 'LightlineFilename'
\ },
\ }
@@ -37,6 +38,15 @@ function! LightlineLinterOK() abort
return l:total == 0 ? 'OK' : ''
endfunction
+function! LightlineFilename()
+ let path = expand('%:p')
+ let root = trim(system('git rev-parse --show-toplevel 2>/dev/null'))
+ if v:shell_error == 0 && path[:len(root)-1] ==# root
+ return path[len(root)+1:]
+ endif
+ return expand('%')
+endfunction
+
augroup LightLineOnLSP
autocmd!
autocmd User lsp_diagnostics_updated call lightline#update()
diff --git a/_config/113-auto-touch-on-save.vim b/_config/113-auto-touch-on-save.vim
index 7505741..d1bdf9c 100644
--- a/_config/113-auto-touch-on-save.vim
+++ b/_config/113-auto-touch-on-save.vim
@@ -1,2 +1,4 @@
+UsePlugin 'auto-touch-on-save.vim'
+
let g:auto_touch_on_save_condition = 'podman machine list --format "{{ .Running }}" | grep -q true'
let g:auto_touch_on_save_command = 'podman machine ssh -- touch'