mirror of
https://github.com/kmein/niveum
synced 2026-03-19 11:31:09 +01:00
feat(neovim): use editorconfig for stripping trailiing whitespace
This commit is contained in:
@@ -8,6 +8,22 @@
|
|||||||
environment.shellAliases.vim = "nvim";
|
environment.shellAliases.vim = "nvim";
|
||||||
environment.shellAliases.view = "nvim -R";
|
environment.shellAliases.view = "nvim -R";
|
||||||
|
|
||||||
|
home-manager.users.me = {
|
||||||
|
editorconfig = {
|
||||||
|
enable = true;
|
||||||
|
settings = {
|
||||||
|
"*" = {
|
||||||
|
charset = "utf-8";
|
||||||
|
end_of_line = "lf";
|
||||||
|
trim_trailing_whitespace = true;
|
||||||
|
insert_final_newline = true;
|
||||||
|
indent_style = "space";
|
||||||
|
indent_size = 2;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
environment.systemPackages = [
|
environment.systemPackages = [
|
||||||
(pkgs.writers.writeDashBin "vim" ''neovim "$@"'')
|
(pkgs.writers.writeDashBin "vim" ''neovim "$@"'')
|
||||||
niveumPackages.vim
|
niveumPackages.vim
|
||||||
|
|||||||
@@ -38,19 +38,6 @@ set foldlevelstart=30
|
|||||||
|
|
||||||
nnoremap <C-H> <CMD>set nohlsearch<CR>
|
nnoremap <C-H> <CMD>set nohlsearch<CR>
|
||||||
|
|
||||||
fun! TrimWhitespace()
|
|
||||||
let l:save = winsaveview()
|
|
||||||
" remove trailing whitespace in lines
|
|
||||||
keeppatterns %s/\s\+$//e
|
|
||||||
" remove empty lines at file end
|
|
||||||
silent! %s#\($\n\s*\)\+\%$##
|
|
||||||
call winrestview(l:save)
|
|
||||||
endfun
|
|
||||||
command! TrimWhitespace call TrimWhitespace()
|
|
||||||
autocmd BufWritePre * if !&binary && &ft !=# 'mail'
|
|
||||||
\| call TrimWhitespace()
|
|
||||||
\| endif
|
|
||||||
|
|
||||||
let g:netrw_banner=0
|
let g:netrw_banner=0
|
||||||
let g:netrw_browse_split=4
|
let g:netrw_browse_split=4
|
||||||
let g:netrw_altv=1 " open splits to the right
|
let g:netrw_altv=1 " open splits to the right
|
||||||
|
|||||||
@@ -21,6 +21,8 @@
|
|||||||
cmp-cmdline
|
cmp-cmdline
|
||||||
luasnip
|
luasnip
|
||||||
|
|
||||||
|
editorconfig-vim
|
||||||
|
|
||||||
fzf-vim
|
fzf-vim
|
||||||
fzfWrapper
|
fzfWrapper
|
||||||
supertab
|
supertab
|
||||||
|
|||||||
Reference in New Issue
Block a user