From d62375a3403fa2db69d71c6f0ce087899f3c32f1 Mon Sep 17 00:00:00 2001 From: Jeff LANCE Date: Wed, 3 Mar 2021 12:21:07 +0100 Subject: [PATCH] add editor config setup to vim --- conf.d/nvim/init.vim | 86 ++++++++++++++++++++++++-------------------- conf.d/nvim/plug.vim | 5 ++- conf/editorconfig | 17 ++++++--- 3 files changed, 64 insertions(+), 44 deletions(-) diff --git a/conf.d/nvim/init.vim b/conf.d/nvim/init.vim index 9261beb..d9e8b12 100644 --- a/conf.d/nvim/init.vim +++ b/conf.d/nvim/init.vim @@ -1,17 +1,17 @@ -" File : .vimrc +" File : init.vim " Author : Jeff LANCE " Date : 15.04.2015 -" Last Modified Date: 27.01.2021 +" Last Modified Date: 03.03.2021 " Last Modified By : Jeff LANCE """""""""""""""""""""""""""""""""""""""""""""" " -" ____ _____ _ _ _____ ____ _ _ -" / ___| ____| \ | | ____| _ \ / \ | | -"| | _| _| | \| | _| | |_) | / _ \ | | -"| |_| | |___| |\ | |___| _ < / ___ \| |___ -" \____|_____|_| \_|_____|_| \_\/_/ \_\_____| -" +" ____ _____ _ _ _____ ____ _ _ +" / ___| ____| \ | | ____| _ \ / \ | | +"| | _| _| | \| | _| | |_) | / _ \ | | +"| |_| | |___| |\ | |___| _ < / ___ \| |___ +" \____|_____|_| \_|_____|_| \_\/_/ \_\_____| +" " """""""""""""""""""""""""""""""""""""""""""""""" @@ -154,14 +154,14 @@ autocmd BufEnter * silent! lcd %:p:h """""""""""""""""""""""""""""""""""""""""""""""""""""" " ___ _ _ _____ _____ ____ _____ _ ____ _____ -" |_ _| \ | |_ _| ____| _ \| ___/ \ / ___| ____| +" |_ _| \ | |_ _| ____| _ \| ___/ \ / ___| ____| " | || \| | | | | _| | |_) | |_ / _ \| | | _| " | || |\ | | | | |___| _ <| _/ ___ \ |___| |___ " |___|_| \_| |_| |_____|_| \_\_|/_/ \_\____|_____| " """""""""""""""""""""""""""""""""""""""""""""""""""""" -" To use fancy symbols wherever possible, +" To use fancy symbols wherever possible, let fancy_symbols_enabled = 1 " Font config @@ -173,13 +173,13 @@ endif set noruler " Keep at least 2 lines above/below -set scrolloff=2 +set scrolloff=2 " hide ~ tila -set fcs=eob:\ +set fcs=eob:\ " Remove ugly vertical lines on window division -set fillchars+=vert:\ +set fillchars+=vert:\ " vim tab title set title @@ -219,9 +219,9 @@ au BufNewFile,BufRead *.js, *.html, *.css \ set tabstop=2 \ set softtabstop=2 \ set shiftwidth=2 -" astroid format=flowed -au FileType mail setlocal tw=72 -au FileType mail setlocal fo+=q +" astroid format=flowed +au FileType mail setlocal tw=72 +au FileType mail setlocal fo+=q au FileType mail setlocal comments+=nb:> " Let the cursor traverse to the previous or following line when at the or the @@ -278,18 +278,18 @@ endif """"""""""""""""""""""""""""""""""""""""""" -" ____ _ _ _ ____ ___ _ _ ____ -" | _ \| | | | | |/ ___|_ _| \ | / ___| -" | |_) | | | | | | | _ | || \| \___ \ -" | __/| |__| |_| | |_| || || |\ |___) | +" ____ _ _ _ ____ ___ _ _ ____ +" | _ \| | | | | |/ ___|_ _| \ | / ___| +" | |_) | | | | | | | _ | || \| \___ \ +" | __/| |__| |_| | |_| || || |\ |___) | " |_| |_____\___/ \____|___|_| \_|____/ -" +" """"""""""""""""""""""""""""""""""""""""""" " Installing the Plug plugin manager source ${HOME}/.config/nvim/plug.vim -" Start startify if no arg +" Start startify if no arg autocmd StdinReadPre * let s:std_in=1 autocmd VimEnter * \ if (argc() == 0 && !exists("s:std_in") && !has('gui')) @@ -311,7 +311,7 @@ autocmd VimEnter * """"""""""""""""""""""""""""""""""""""""""""""""""""""""""" " ____ _____ _ _____ _ _ ____ _ ___ _ _ _____ -" / ___|_ _|/ \|_ _| | | / ___|| | |_ _| \ | | ____| +" / ___|_ _|/ \|_ _| | | / ___|| | |_ _| \ | | ____| " \___ \ | | / _ \ | | | | | \___ \| | | || \| | _| " ___) || |/ ___ \| | | |_| |___) | |___ | || |\ | |___ " |____/ |_/_/ \_\_| \___/|____/|_____|___|_| \_|_____| @@ -328,7 +328,7 @@ endif """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " ____ ___ _ ___ ____ ____ ____ _ _ _____ __ __ _____ -" / ___/ _ \| | / _ \| _ \/ ___| / ___| | | | ____| \/ | ____| +" / ___/ _ \| | / _ \| _ \/ ___| / ___| | | | ____| \/ | ____| " | | | | | | | | | | | |_) \___ \| | | |_| | _| | |\/| | _| " | |__| |_| | |__| |_| | _ < ___) | |___| _ | |___| | | | |___ " \____\___/|_____\___/|_| \_\____/ \____|_| |_|_____|_| |_|_____| @@ -381,7 +381,7 @@ function! g:BuffetSetCustomColors() """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " _ _ _ _ _ " _ __ | |_ _ __ _(_)_ __ ___ ___ ___| |_| |_(_)_ __ __ _ ___ -" | '_ \| | | | |/ _` | | '_ \/ __| / __|/ _ \ __| __| | '_ \ / _` / __| +" | '_ \| | | | |/ _` | | '_ \/ __| / __|/ _ \ __| __| | '_ \ / _` / __| " | |_) | | |_| | (_| | | | | \__ \ \__ \ __/ |_| |_| | | | | (_| \__ \ " | .__/|_|\__,_|\__, |_|_| |_|___/ |___/\___|\__|\__|_|_| |_|\__, |___/ " |_| |___/ |___/ @@ -471,6 +471,16 @@ let g:deoplete#enable_at_startup = 0 " }}} +" Editorconfig {{{ +" ----- + +let g:EditorConfig_exclude_patterns = ['fugitive://.*', 'scp://.*'] +au FileType gitcommit let b:EditorConfig_disable = 1 + +" ----- +" }}} + + " FZF {{{ " ----- @@ -498,7 +508,7 @@ endif let g:header_field_author = 'Jeff LANCE' let g:header_field_author_email = 'email@jefflance.me' -let g:header_auto_add_header = 0 +let g:header_auto_add_header = 1 " ----- " }}} @@ -610,9 +620,9 @@ let g:tex_flavor = 'latex' """"""""""""""""""""""""""""""""""""""""""""""""" " ____ _____ _ ____ _____ ___ _______ __ " / ___|_ _|/ \ | _ \_ _|_ _| ___\ \ / / -" \___ \ | | / _ \ | |_) || | | || |_ \ V / -" ___) || |/ ___ \| _ < | | | || _| | | -" |____/ |_/_/ \_\_| \_\|_| |___|_| |_| +" \___ \ | | / _ \ | |_) || | | || |_ \ V / +" ___) || |/ ___ \| _ < | | | || _| | | +" |____/ |_/_/ \_\_| \_\|_| |___|_| |_| " """"""""""""""""""""""""""""""""""""""""""""""""" @@ -622,13 +632,13 @@ source ${HOME}/.config/nvim/startscreen.vim """"""""""""""""""""""""""""""""""""""""""""""""""""""" -" _____ _ _ _ _ ____ _____ ___ ___ _ _ ____ -" | ___| | | | \ | |/ ___|_ _|_ _/ _ \| \ | / ___| -" | |_ | | | | \| | | | | | | | | | \| \___ \ -" | _| | |_| | |\ | |___ | | | | |_| | |\ |___) | -" |_| \___/|_| \_|\____| |_| |___\___/|_| \_|____/ -" -" +" _____ _ _ _ _ ____ _____ ___ ___ _ _ ____ +" | ___| | | | \ | |/ ___|_ _|_ _/ _ \| \ | / ___| +" | |_ | | | | \| | | | | | | | | | \| \___ \ +" | _| | |_| | |\ | |___ | | | | |_| | |\ |___) | +" |_| \___/|_| \_|\____| |_| |___\___/|_| \_|____/ +" +" """"""""""""""""""""""""""""""""""""""""""""""""""""""" " Load functions from file @@ -640,9 +650,9 @@ source ${HOME}/.config/nvim/functions.vim " _ _________ ______ ___ _ _ ____ ___ _ _ ____ ____ " | |/ / ____\ \ / / __ )_ _| \ | | _ \_ _| \ | |/ ___/ ___| " | ' /| _| \ V /| _ \| || \| | | | | || \| | | _\___ \ -" | . \| |___ | | | |_) | || |\ | |_| | || |\ | |_| |___) | +" | . \| |___ | | | |_) | || |\ | |_| | || |\ | |_| |___) | " |_|\_\_____| |_| |____/___|_| \_|____/___|_| \_|\____|____/ -" +" """"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" " Load keybindings from file diff --git a/conf.d/nvim/plug.vim b/conf.d/nvim/plug.vim index 36b78a4..367921d 100644 --- a/conf.d/nvim/plug.vim +++ b/conf.d/nvim/plug.vim @@ -1,7 +1,7 @@ " File : plug.vim " Author : Jeff LANCE " Date : 15.04.2015 -" Last Modified Date: 24.06.2020 +" Last Modified Date: 03.03.2021 " Last Modified By : Jeff LANCE """""""""""""""""""""""""""""""""""""""""""""""" @@ -51,6 +51,9 @@ Plug 'roxma/vim-hug-neovim-rpc' " Buffer exploration Plug 'bagrat/vim-buffet', { 'as': 'buffet' } +" Editorconfig +Plug 'editorconfig/editorconfig-vim' + " Folding Plug 'Konfekt/FastFold' diff --git a/conf/editorconfig b/conf/editorconfig index ddc081c..21cb651 100644 --- a/conf/editorconfig +++ b/conf/editorconfig @@ -10,21 +10,28 @@ root = true [{*,.*}] end_of_line = lf insert_final_newline = true +trim_trailing_whitespace = true indent_style = space indent_size = 2 max_line_length = 80 charset = utf-8 -[*.py] -indent_style = space -indent_size = 4 -max_line_length = 79 - [{Makefile,makefile,*.mk}] indent_style = tab [*.md] indent_style = space +[*.py] +indent_style = space +indent_size = 4 +max_line_length = 79 + [*.sh] +indent_style = space max_line_length = 0 + +[*.vim] +indent_style = space +max_line_length = 0 +