From c2b404b17f270c9eccc690f962b30d107d3e55d9 Mon Sep 17 00:00:00 2001 From: Anthony Debucquoy Date: Fri, 4 Oct 2024 08:49:11 +0200 Subject: [PATCH] vim and nvim --- .gitmodules | 3 +++ nvim/.config/nvim/after/ftplugin/cmake.lua | 4 ++++ nvim/.config/nvim/after/ftplugin/sh.lua | 4 ++++ nvim/.config/nvim/compiler/esp.lua | 5 +++++ nvim/.config/nvim/init.vim | 1 + nvim/.config/nvim/plugin/configs.lua | 1 + nvim/.config/nvim/plugin/lsp.vim | 7 +++++++ vim/.vim/UltiSnips/tex.snippets | 2 ++ vim/.vim/compiler/{esp.vim => esp_old.vim} | 0 vim/.vim/pack/autoload/start/vim-textidote | 1 + vim/.vimrc | 1 + zsh/.zshrc | 1 + 12 files changed, 30 insertions(+) create mode 100644 nvim/.config/nvim/after/ftplugin/cmake.lua create mode 100644 nvim/.config/nvim/after/ftplugin/sh.lua create mode 100644 nvim/.config/nvim/compiler/esp.lua create mode 100644 nvim/.config/nvim/plugin/lsp.vim rename vim/.vim/compiler/{esp.vim => esp_old.vim} (100%) create mode 160000 vim/.vim/pack/autoload/start/vim-textidote diff --git a/.gitmodules b/.gitmodules index 8341070..55dcad8 100644 --- a/.gitmodules +++ b/.gitmodules @@ -100,3 +100,6 @@ [submodule "vim/.vim/pack/autoload/start/vim-abolish"] path = vim/.vim/pack/autoload/start/vim-abolish url = https://github.com/tpope/vim-abolish +[submodule "vim/.vim/pack/autoload/start/vim-textidote"] + path = vim/.vim/pack/autoload/start/vim-textidote + url = https://github.com/PatrBal/vim-textidote diff --git a/nvim/.config/nvim/after/ftplugin/cmake.lua b/nvim/.config/nvim/after/ftplugin/cmake.lua new file mode 100644 index 0000000..840be69 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/cmake.lua @@ -0,0 +1,4 @@ +vim.lsp.start({ + name = 'cmake-language-server', + cmd = {'cmake-language-server'}, +}) diff --git a/nvim/.config/nvim/after/ftplugin/sh.lua b/nvim/.config/nvim/after/ftplugin/sh.lua new file mode 100644 index 0000000..1b6cdb8 --- /dev/null +++ b/nvim/.config/nvim/after/ftplugin/sh.lua @@ -0,0 +1,4 @@ +vim.lsp.start({ + name = 'bash-language-server', + cmd = {'bash-language-server'}, +}) diff --git a/nvim/.config/nvim/compiler/esp.lua b/nvim/.config/nvim/compiler/esp.lua new file mode 100644 index 0000000..44aa2c5 --- /dev/null +++ b/nvim/.config/nvim/compiler/esp.lua @@ -0,0 +1,5 @@ +vim.lsp.stop_client(vim.lsp.get_clients()) +vim.lsp.start({ + name = 'clangd', + cmd = {'/home/tonitch/Documents/aur/llvm-espressif/src/esp-clang/bin/clangd', "--query-driver=/home/tonitch/.espressif/tools/xtensa-esp32s3-elf/esp-12.2.0_20230208/**/bin/xtensa-esp32-elf-*"}, +}) diff --git a/nvim/.config/nvim/init.vim b/nvim/.config/nvim/init.vim index f182e5b..61b9e52 100644 --- a/nvim/.config/nvim/init.vim +++ b/nvim/.config/nvim/init.vim @@ -1,3 +1,4 @@ set runtimepath^=~/.vim runtimepath+=~/.vim/after let &packpath = &runtimepath +let g:python3_host_prog="/usr/bin/python" source ~/.vimrc diff --git a/nvim/.config/nvim/plugin/configs.lua b/nvim/.config/nvim/plugin/configs.lua index 4b6d1d1..a6d7364 100644 --- a/nvim/.config/nvim/plugin/configs.lua +++ b/nvim/.config/nvim/plugin/configs.lua @@ -1 +1,2 @@ vim.g.vimtex_view_method="zathura" +vim.opt.completeopt="menu,popup,noinsert,noselect" diff --git a/nvim/.config/nvim/plugin/lsp.vim b/nvim/.config/nvim/plugin/lsp.vim new file mode 100644 index 0000000..ea2ff89 --- /dev/null +++ b/nvim/.config/nvim/plugin/lsp.vim @@ -0,0 +1,7 @@ +function! OpenCompletion() + if !pumvisible() && ((v:char >= 'a' && v:char <= 'z') || (v:char >= 'A' && v:char <= 'Z')) + call feedkeys("\\", "n") + endif +endfunction + +autocmd InsertCharPre * if &omnifunc != "" | call OpenCompletion() | endif diff --git a/vim/.vim/UltiSnips/tex.snippets b/vim/.vim/UltiSnips/tex.snippets index 5055e51..4b9f626 100644 --- a/vim/.vim/UltiSnips/tex.snippets +++ b/vim/.vim/UltiSnips/tex.snippets @@ -4,7 +4,9 @@ snippet base "Description" b \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[french]{babel} +\usepackage[pdftex]{graphicx} \usepackage{amsmath, amsfonts, amssymb, amsthm} +\usepackage{fullpage} \title{${2:${VISUAL:Titre}}} \author{${3:${VISUAL:Debucquoy Anthony}}} diff --git a/vim/.vim/compiler/esp.vim b/vim/.vim/compiler/esp_old.vim similarity index 100% rename from vim/.vim/compiler/esp.vim rename to vim/.vim/compiler/esp_old.vim diff --git a/vim/.vim/pack/autoload/start/vim-textidote b/vim/.vim/pack/autoload/start/vim-textidote new file mode 160000 index 0000000..861bce1 --- /dev/null +++ b/vim/.vim/pack/autoload/start/vim-textidote @@ -0,0 +1 @@ +Subproject commit 861bce10ee9b6c2acf39b0abba805d6d696b63d5 diff --git a/vim/.vimrc b/vim/.vimrc index 9e3d2c8..eadaf16 100644 --- a/vim/.vimrc +++ b/vim/.vimrc @@ -37,6 +37,7 @@ execute "set =\eg" nnoremap :call GFilesFallback() nnoremap :vert term +nnoremap z :MaximizerToggle let g:netrw_keepdir=0 let g:netrw_banner=0 diff --git a/zsh/.zshrc b/zsh/.zshrc index 3324d6c..2ae8eba 100644 --- a/zsh/.zshrc +++ b/zsh/.zshrc @@ -71,6 +71,7 @@ alias get_idf='source /opt/esp-idf/export.sh' alias open="xdg-open" alias sxiv=nsxiv alias :q=exit +alias vim=nvim # Theming section autoload -U compinit colors zcalc