mirror of
https://github.com/luzifer/vim.git
synced 2024-12-20 10:21:19 +00:00
Replace autocommand breaking my files
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
7c33d30f56
commit
f6c668ea88
2 changed files with 22 additions and 31 deletions
|
@ -1,10 +0,0 @@
|
||||||
if exists('g:loaded_shfmt_wrapper')
|
|
||||||
finish
|
|
||||||
endif
|
|
||||||
let g:loaded_shfmt_wrapper = 1
|
|
||||||
|
|
||||||
function! SHFmt()
|
|
||||||
let save_pos = getpos(".")
|
|
||||||
execute "%!shfmt -s"
|
|
||||||
call setpos(".", save_pos)
|
|
||||||
endfunction
|
|
43
init.vim
43
init.vim
|
@ -32,6 +32,7 @@ Plug 'Matt-Deacalion/vim-systemd-syntax'
|
||||||
Plug 'mutewinter/nginx.vim'
|
Plug 'mutewinter/nginx.vim'
|
||||||
Plug 'posva/vim-vue'
|
Plug 'posva/vim-vue'
|
||||||
Plug 'NoahTheDuke/vim-just'
|
Plug 'NoahTheDuke/vim-just'
|
||||||
|
Plug 'z0mbix/vim-shfmt', { 'for': 'sh' }
|
||||||
|
|
||||||
call plug#end()
|
call plug#end()
|
||||||
|
|
||||||
|
@ -55,7 +56,7 @@ set pt=
|
||||||
|
|
||||||
"
|
"
|
||||||
" using the mouse
|
" using the mouse
|
||||||
"
|
"
|
||||||
|
|
||||||
" mouse - list of flags for using the mouse
|
" mouse - list of flags for using the mouse
|
||||||
set mouse=n
|
set mouse=n
|
||||||
|
@ -74,7 +75,7 @@ set ve=block
|
||||||
|
|
||||||
"
|
"
|
||||||
" selecting text
|
" selecting text
|
||||||
"
|
"
|
||||||
|
|
||||||
" selection - "old", "inclusive" or "exclusive"; how selecting text behaves
|
" selection - "old", "inclusive" or "exclusive"; how selecting text behaves
|
||||||
set sel=old
|
set sel=old
|
||||||
|
@ -91,7 +92,7 @@ set km=
|
||||||
|
|
||||||
"
|
"
|
||||||
" terminal
|
" terminal
|
||||||
"
|
"
|
||||||
|
|
||||||
" term - name of the used terminal
|
" term - name of the used terminal
|
||||||
"set term=builtin_gui
|
"set term=builtin_gui
|
||||||
|
@ -122,7 +123,7 @@ set iconstring=
|
||||||
|
|
||||||
"
|
"
|
||||||
" moving around, searching and patterns
|
" moving around, searching and patterns
|
||||||
"
|
"
|
||||||
|
|
||||||
" whichwrap - list of flags specifying which commands wrap to another line (local to window)
|
" whichwrap - list of flags specifying which commands wrap to another line (local to window)
|
||||||
set ww=b,s
|
set ww=b,s
|
||||||
|
@ -175,7 +176,7 @@ set inex=
|
||||||
|
|
||||||
"
|
"
|
||||||
" syntax and highlighting
|
" syntax and highlighting
|
||||||
"
|
"
|
||||||
|
|
||||||
" enable syntax highlighting by default
|
" enable syntax highlighting by default
|
||||||
syntax enable
|
syntax enable
|
||||||
|
@ -191,7 +192,7 @@ set hls " nohls
|
||||||
|
|
||||||
"
|
"
|
||||||
" displaying text
|
" displaying text
|
||||||
"
|
"
|
||||||
|
|
||||||
" scroll - number of lines to scroll for CTRL-U and CTRL-D (local to window)
|
" scroll - number of lines to scroll for CTRL-U and CTRL-D (local to window)
|
||||||
set scr=6
|
set scr=6
|
||||||
|
@ -251,7 +252,7 @@ set nu " nonu
|
||||||
|
|
||||||
"
|
"
|
||||||
" editing text
|
" editing text
|
||||||
"
|
"
|
||||||
|
|
||||||
" undolevels - maximum number of changes that can be undone
|
" undolevels - maximum number of changes that can be undone
|
||||||
set ul=1000
|
set ul=1000
|
||||||
|
@ -315,7 +316,7 @@ set nf=octal,hex
|
||||||
|
|
||||||
"
|
"
|
||||||
" tabs and indenting
|
" tabs and indenting
|
||||||
"
|
"
|
||||||
|
|
||||||
" tabstop - number of spaces a <Tab> in the text stands for (local to buffer)
|
" tabstop - number of spaces a <Tab> in the text stands for (local to buffer)
|
||||||
set ts=2
|
set ts=2
|
||||||
|
@ -420,7 +421,7 @@ set fdn=20
|
||||||
|
|
||||||
"
|
"
|
||||||
" multiple windows
|
" multiple windows
|
||||||
"
|
"
|
||||||
|
|
||||||
" laststatus - 0, 1 or 2; when to use a status line for the last window
|
" laststatus - 0, 1 or 2; when to use a status line for the last window
|
||||||
set ls=0
|
set ls=0
|
||||||
|
@ -478,7 +479,7 @@ set sbo=ver,jump
|
||||||
|
|
||||||
"
|
"
|
||||||
" messages and info
|
" messages and info
|
||||||
"
|
"
|
||||||
|
|
||||||
" terse - add 's' flag in 'shortmess' (don't show search message)
|
" terse - add 's' flag in 'shortmess' (don't show search message)
|
||||||
set noterse " terse
|
set noterse " terse
|
||||||
|
@ -521,7 +522,7 @@ set hlg=
|
||||||
|
|
||||||
"
|
"
|
||||||
" diff mode
|
" diff mode
|
||||||
"
|
"
|
||||||
|
|
||||||
" diff - use diff mode for the current window (local to window)
|
" diff - use diff mode for the current window (local to window)
|
||||||
set nodiff " diff
|
set nodiff " diff
|
||||||
|
@ -537,7 +538,7 @@ set pex=
|
||||||
|
|
||||||
"
|
"
|
||||||
" mapping
|
" mapping
|
||||||
"
|
"
|
||||||
|
|
||||||
" maxmapdepth - maximum depth of mapping
|
" maxmapdepth - maximum depth of mapping
|
||||||
set mmd=1000
|
set mmd=1000
|
||||||
|
@ -559,7 +560,7 @@ set ttm=-1
|
||||||
|
|
||||||
"
|
"
|
||||||
" reading and writing files
|
" reading and writing files
|
||||||
"
|
"
|
||||||
|
|
||||||
" modeline - enable using settings from modelines when reading a file (local to buffer)
|
" modeline - enable using settings from modelines when reading a file (local to buffer)
|
||||||
set ml " noml
|
set ml " noml
|
||||||
|
@ -620,7 +621,7 @@ set pm=
|
||||||
|
|
||||||
"
|
"
|
||||||
" the swap file
|
" the swap file
|
||||||
"
|
"
|
||||||
|
|
||||||
" directory - list of directories for the swap file
|
" directory - list of directories for the swap file
|
||||||
"set dir=.,/home/groover/tmp,/home/groover,/var/tmp,/tmp
|
"set dir=.,/home/groover/tmp,/home/groover,/var/tmp,/tmp
|
||||||
|
@ -638,7 +639,7 @@ set ut=4000
|
||||||
" command line editing
|
" command line editing
|
||||||
"
|
"
|
||||||
|
|
||||||
" history - how many command lines are remembered
|
" history - how many command lines are remembered
|
||||||
set hi=100
|
set hi=100
|
||||||
|
|
||||||
" wildchar - key that triggers command-line expansion
|
" wildchar - key that triggers command-line expansion
|
||||||
|
@ -670,7 +671,7 @@ set cwh=7
|
||||||
|
|
||||||
"
|
"
|
||||||
" executing external commands
|
" executing external commands
|
||||||
"
|
"
|
||||||
|
|
||||||
" shell - name of the shell program used for external commands
|
" shell - name of the shell program used for external commands
|
||||||
set sh=/bin/bash
|
set sh=/bin/bash
|
||||||
|
@ -741,7 +742,7 @@ set csqf=
|
||||||
|
|
||||||
"
|
"
|
||||||
" running make and jumping to errors
|
" running make and jumping to errors
|
||||||
"
|
"
|
||||||
|
|
||||||
" errorfile - name of the file that contains error messages
|
" errorfile - name of the file that contains error messages
|
||||||
set ef=errors.err
|
set ef=errors.err
|
||||||
|
@ -766,7 +767,7 @@ set gfm=%f:%l:%m,%f:%l%m,%f\ \ %l%m
|
||||||
|
|
||||||
"
|
"
|
||||||
" language specific
|
" language specific
|
||||||
"
|
"
|
||||||
|
|
||||||
" isfname - specifies the characters in a file name
|
" isfname - specifies the characters in a file name
|
||||||
set isf=@,48-57,/,.,-,_,+,,,#,$,%,~,=
|
set isf=@,48-57,/,.,-,_,+,,,#,$,%,~,=
|
||||||
|
@ -830,7 +831,7 @@ set noimc " imc
|
||||||
|
|
||||||
"
|
"
|
||||||
" multi-byte characters
|
" multi-byte characters
|
||||||
"
|
"
|
||||||
|
|
||||||
" encoding - character encoding used in Vim: "latin1", "utf-8", "euc-jp", "big5", etc.
|
" encoding - character encoding used in Vim: "latin1", "utf-8", "euc-jp", "big5", etc.
|
||||||
set enc=utf-8
|
set enc=utf-8
|
||||||
|
@ -855,7 +856,7 @@ set ambw=single
|
||||||
|
|
||||||
"
|
"
|
||||||
" various
|
" various
|
||||||
"
|
"
|
||||||
|
|
||||||
" cursorline - show a marker on the current line
|
" cursorline - show a marker on the current line
|
||||||
set cursorline
|
set cursorline
|
||||||
|
@ -988,9 +989,9 @@ let g:LanguageClient_serverCommands = {
|
||||||
"
|
"
|
||||||
|
|
||||||
let g:formatters_vue = ['eslint_local']
|
let g:formatters_vue = ['eslint_local']
|
||||||
|
let g:shfmt_fmt_on_save = 1
|
||||||
|
|
||||||
au FileType python,javascript,vue au BufWritePre <buffer> :Autoformat
|
au FileType python,javascript,vue au BufWritePre <buffer> :Autoformat
|
||||||
au FileType sh,zsh au BufWritePre <buffer> :call SHFmt()
|
|
||||||
|
|
||||||
"
|
"
|
||||||
" typescript-vim configuration
|
" typescript-vim configuration
|
||||||
|
|
Loading…
Reference in a new issue