From 0904591145327fa2c6ca4d9bbe2b50ca6b60085a Mon Sep 17 00:00:00 2001 From: Max Christian Pohle Date: Fri, 23 Dec 2022 11:38:26 +0100 Subject: Refactored a tiny bit and added editorconfig --- .gitmodules | 9 ++++++++ init.lua | 6 +++-- pack/all/start/vim-editorconfig | 1 + pack/nvim/start/nvim-cmp-buffer | 1 + pack/nvim/start/nvim-cmp-lsp-signature-help | 1 + vimrc | 4 +++- vimrc-common | 35 ++++++++++++++++------------- 7 files changed, 39 insertions(+), 18 deletions(-) create mode 160000 pack/all/start/vim-editorconfig create mode 160000 pack/nvim/start/nvim-cmp-buffer create mode 160000 pack/nvim/start/nvim-cmp-lsp-signature-help diff --git a/.gitmodules b/.gitmodules index 00d4440..d09951e 100644 --- a/.gitmodules +++ b/.gitmodules @@ -46,3 +46,12 @@ [submodule "pack/submodules/opt/vim-youcompleteme"] path = pack/vim/opt/vim-youcompleteme url = https://github.com/Valloric/YouCompleteMe.git +[submodule "pack/nvim/start/nvim-cmp-buffer"] + path = pack/nvim/start/nvim-cmp-buffer + url = https://github.com/hrsh7th/cmp-buffer +[submodule "pack/nvim/start/nvim-cmp-lsp-signature-help"] + path = pack/nvim/start/nvim-cmp-lsp-signature-help + url = https://github.com/hrsh7th/cmp-nvim-lsp-signature-help +[submodule "pack/all/start/vim-editorconfig"] + path = pack/all/start/vim-editorconfig + url = https://github.com/cxw42/editorconfig-vim diff --git a/init.lua b/init.lua index 0184d42..c63a9e1 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,7 @@ -vim.cmd('set termguicolors') -vim.cmd('source ~/.vim/vimrc') +-- vim.cmd('source ~/.vim/vimrc') + +vim.o.termguicolors = true +vim.o.exrc = true require'man' diff --git a/pack/all/start/vim-editorconfig b/pack/all/start/vim-editorconfig new file mode 160000 index 0000000..30ddc05 --- /dev/null +++ b/pack/all/start/vim-editorconfig @@ -0,0 +1 @@ +Subproject commit 30ddc057f71287c3ac2beca876e7ae6d5abe26a0 diff --git a/pack/nvim/start/nvim-cmp-buffer b/pack/nvim/start/nvim-cmp-buffer new file mode 160000 index 0000000..3022dbc --- /dev/null +++ b/pack/nvim/start/nvim-cmp-buffer @@ -0,0 +1 @@ +Subproject commit 3022dbc9166796b644a841a02de8dd1cc1d311fa diff --git a/pack/nvim/start/nvim-cmp-lsp-signature-help b/pack/nvim/start/nvim-cmp-lsp-signature-help new file mode 160000 index 0000000..d2768cb --- /dev/null +++ b/pack/nvim/start/nvim-cmp-lsp-signature-help @@ -0,0 +1 @@ +Subproject commit d2768cb1b83de649d57d967085fe73c5e01f8fd7 diff --git a/vimrc b/vimrc index a76471b..ea8ee2b 100644 --- a/vimrc +++ b/vimrc @@ -15,7 +15,9 @@ if ($XDG_SESSION_TYPE ==# 'wayland' || ! empty($WAYLAND_DISPLAY)) endif -set shadafile="/tmp/shada" +if has("nvim") + set shadafile="/tmp/shada" +endif " neovide specific set guifont=monospace:h11:b diff --git a/vimrc-common b/vimrc-common index 6f0d7af..6201d4b 100644 --- a/vimrc-common +++ b/vimrc-common @@ -4,25 +4,30 @@ " project-local .vimrc file (activated with exrc setting) "======================================================================================================================= -set exrc | " enable exrc, a specific .exrc per project, which can contain usual .vimrc commands -set modeline | " set variables specific to a file, like indentation by adding a comment -set textwidth=0 | " better done with modeline or local exrc and not here -set ts=4 sts=4 sw=4 expandtab | " better done with a modeline or local exrc -set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against -set number norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis -set ignorecase smartcase | " search with ignore case by default, but use case sensitive search when one capital char is contained and highlight while typing (even though its slower) -set hlsearch incsearch | " highlight pattern while entering it (performance wise this isn't that good) -" set cindent cinoptions+=(0 | " indent at parentheses - -set path+=** | " allow recursive searches for files -let &path = &path.",/usr/lib/modules/".substitute(system('uname -r'), "\n", "", "")."/build/include" - filetype on filetype plugin on filetype indent on -syntax on | " enable syntax highlighting -syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) +syntax on | " enable syntax highlighting +syntax sync minlines=60 | " how many preceding lines will be parsed? (has performance impact) + +set secure | " to ensure, that modelines do not contain executable code +set noexrc | " exrc was nice, but has too many security problems. Now using editorconfig instead (see plugins) +set modeline | " set variables specific to a file, like indentation by adding a comment (TODO: should probably be replaced by editorconfig) +set ts=4 sts=4 sw=4 expandtab textwidth=0 | " better done with a modeline or local exrc +set virtualedit=all | " virtual edit should be default behaviour, because I don't see any reason against +set number norelativenumber | " do not show numbers by default, because that causes a performance loss, instead activate them on a file type basis +set ignorecase smartcase | " search with ignore case by default, but use case sensitive search when one capital char is contained and highlight while typing (even though its slower) +set hlsearch incsearch | " highlight pattern while entering it (performance wise this isn't that good) +" set cindent cinoptions+=(0 | " indent at parentheses + + +"======================================================================================================================= +" PATH -- where to search for includes (e.g. `gf` or `:find`) +"======================================================================================================================= +set path+=** | " allow recursive searches for files +let &path = &path.",/usr/lib/modules/".substitute(system('uname -r'), "\n", "", "")."/build/include" | " TODO: could fail under windows (no uname) + "======================================================================================================================= " SPELL_CHECKING: -- cgit v1.2.3