From 2a07150ae8d9da8bae82d308b39358c14ce165da Mon Sep 17 00:00:00 2001 From: tiyn Date: Sat, 13 Aug 2022 03:26:41 +0200 Subject: [PATCH 1/6] aliasrc: added flacsplit --- .config/aliasrc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.config/aliasrc b/.config/aliasrc index 06b8c12..7c8d442 100644 --- a/.config/aliasrc +++ b/.config/aliasrc @@ -20,6 +20,9 @@ alias c="clear" # config alias config="/usr/bin/git --git-dir=$HOME/.dotfiles --work-tree=$HOME" +# cuebreakpoints +flacsplit() { cuebreakpoints $2 | shnsplit $1 -o flac } + # diff alias diff="diff --color=auto" From 5625e6ecfc0fcaaf97d5b515d726ac1ce84c51c6 Mon Sep 17 00:00:00 2001 From: tiyn Date: Sat, 3 Sep 2022 02:02:37 +0200 Subject: [PATCH 2/6] nvim: added markdown lsp --- .config/nvim/init.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index b40159c..6e2e703 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -165,7 +165,7 @@ end -- Use a loop to conveniently call 'setup' on multiple servers and -- map buffer local keybindings when the language server attaches -local servers = { "pyright", "bashls", "tsserver", "texlab", "ccls", "gopls", "hls", "nimls" } +local servers = { "pyright", "bashls", "tsserver", "texlab", "ccls", "gopls", "hls", "nimls", "marksman" } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach=on_attach, @@ -176,6 +176,7 @@ for _, lsp in ipairs(servers) do } end + require'lspconfig'.jdtls.setup{ on_attach=on_attach, flags = { From e194e2f9bb8fe8cf1624cc442d34ef02172bdb63 Mon Sep 17 00:00:00 2001 From: tiyn Date: Sat, 3 Sep 2022 05:33:31 +0200 Subject: [PATCH 3/6] nvim: icons for completion --- .config/nvim/init.vim | 49 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 6e2e703..ac90cb9 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -23,6 +23,7 @@ Plug 'luochen1990/rainbow' " colorized matching brackets Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} " show tags Plug 'mattesgroeger/vim-bookmarks' " Set Bookmarks Plug 'neovim/nvim-lspconfig' " Language server client +Plug 'onsails/lspkind-nvim' " icons on completion Plug 'qpkorr/vim-renamer' " bulk renamer Plug 'raimondi/delimitmate' " automatic closing of brackets Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " color Preview @@ -121,10 +122,17 @@ vim.o.completeopt = 'menuone,noselect' -- nvim-cmp setup local cmp = require 'cmp' +local lspkind = require("lspkind") cmp.setup { mapping = { [''] = cmp.mapping.select_prev_item(), - [''] = cmp.mapping.select_next_item(), + [""] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_next_item() + else + fallback() + end + end, { "i", "s" }), [''] = cmp.mapping.close(), [''] = cmp.mapping.confirm { behavior = cmp.ConfirmBehavior.Replace, @@ -135,6 +143,45 @@ cmp.setup { { name = 'path'}, { name = 'buffer' }, }, + formatting = { + format = lspkind.cmp_format({ + mode = "symbol_text", + preset = "codicons", + maxwidth = 50, + menu = { + nvim_lsp = "[LSP]", + path = "[PATH]", + buffer = "[BUF]", + }, + symbol_map = { + Text = "", + Method = "", + Function = "", + Constructor = "", + Field = "ﰠ", + Variable = "", + Class = "ﴯ", + Interface = "", + Module = "", + Property = "ﰠ", + Unit = "塞", + Value = "", + Enum = "", + Keyword = "", + Snippet = "", + Color = "", + File = "", + Reference = "", + Folder = "", + EnumMember = "", + Constant = "", + Struct = "פּ", + Event = "", + Operator = "", + TypeParameter = "" + }, + }), + }, } EOF From 9b60120f65f0000480a9d370b5add43ba1599ccf Mon Sep 17 00:00:00 2001 From: tiyn Date: Sat, 3 Sep 2022 05:47:35 +0200 Subject: [PATCH 4/6] nvim: added snippet support --- .config/nvim/init.vim | 37 ++++++++++++++++++++++++------ .config/nvim/snippets/tex.snippets | 10 ++++++++ 2 files changed, 40 insertions(+), 7 deletions(-) create mode 100644 .config/nvim/snippets/tex.snippets diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index ac90cb9..56c0e1b 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -19,6 +19,7 @@ Plug 'hrsh7th/nvim-cmp' " autocompletion Plug 'hrsh7th/cmp-nvim-lsp' " autocompletion bridge to lsp Plug 'itchyny/lightline.vim' " fancy statusline Plug 'junegunn/fzf.vim' " quickly jump files using fzf +Plug 'L3MON4D3/LuaSnip' " Snippet support Plug 'luochen1990/rainbow' " colorized matching brackets Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} " show tags Plug 'mattesgroeger/vim-bookmarks' " Set Bookmarks @@ -28,6 +29,7 @@ Plug 'qpkorr/vim-renamer' " bulk renamer Plug 'raimondi/delimitmate' " automatic closing of brackets Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " color Preview Plug 'ryanoasis/vim-devicons' " enable icons for vim +Plug 'saadparwaiz1/cmp_luasnip' " Add luasnips to cmp Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} " filetree Plug 'tiyn/vim-tccs' " custom colorscheme Plug 'tpope/vim-fugitive' " git wrapper @@ -115,22 +117,40 @@ let g:bookmark_highlight_lines = 1 lua << EOF -- Add additional capabilities supported by nvim-cmp local capabilities = vim.lsp.protocol.make_client_capabilities() -capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) +capabilities = require("cmp_nvim_lsp").update_capabilities(capabilities) -- Set completeopt to have a better completion experience vim.o.completeopt = 'menuone,noselect' -- nvim-cmp setup -local cmp = require 'cmp' +local cmp = require("cmp") +local luasnip = require("luasnip") local lspkind = require("lspkind") cmp.setup { + snippet = { + expand = function(args) + luasnip.lsp_expand(args.body) + end, + }, mapping = { - [''] = cmp.mapping.select_prev_item(), - [""] = cmp.mapping(function(fallback) + [''] = cmp.mapping(function(fallback) + if cmp.visible() then + cmp.select_prev_item() + elseif luasnip.jumpable(-1) then + luasnip.jump(-1) + else + fallback() + end + end, { "i", "s" }), + [''] = cmp.mapping(function(fallback) if cmp.visible() then - cmp.select_next_item() + cmp.select_next_item() + elseif luasnip.expand_or_jumpable() then + luasnip.expand_or_jump() + elseif has_words_before() then + cmp.complete() else - fallback() + fallback() end end, { "i", "s" }), [''] = cmp.mapping.close(), @@ -140,8 +160,9 @@ cmp.setup { }}, sources = { { name = 'nvim_lsp' }, - { name = 'path'}, + { name = 'path' }, { name = 'buffer' }, + { name = 'luasnip' }, }, formatting = { format = lspkind.cmp_format({ @@ -152,6 +173,7 @@ cmp.setup { nvim_lsp = "[LSP]", path = "[PATH]", buffer = "[BUF]", + luasnip = "[SNIP]", }, symbol_map = { Text = "", @@ -184,6 +206,7 @@ cmp.setup { }, } +require("luasnip.loaders.from_snipmate").lazy_load() EOF " neovim/nvim-lspconfig diff --git a/.config/nvim/snippets/tex.snippets b/.config/nvim/snippets/tex.snippets new file mode 100644 index 0000000..d03641c --- /dev/null +++ b/.config/nvim/snippets/tex.snippets @@ -0,0 +1,10 @@ +# Section +snippet sec \section + \\section{${1:section name}}% + \\label{sec:${2:$1}} + ${0} +# Section without number +snippet sec* \section* + \\section*{${1:section name}}% + \\label{sec:${2:$1}} + ${0} From c81fc673fb9bd69a70522373f5170bc37c670479 Mon Sep 17 00:00:00 2001 From: tiyn Date: Sat, 3 Sep 2022 05:49:50 +0200 Subject: [PATCH 5/6] nvim: added snippet support --- .config/nvim/init.vim | 2 -- 1 file changed, 2 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 56c0e1b..4bf4201 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -147,8 +147,6 @@ cmp.setup { cmp.select_next_item() elseif luasnip.expand_or_jumpable() then luasnip.expand_or_jump() - elseif has_words_before() then - cmp.complete() else fallback() end From 1f48e040f1b3acd4ea326bec9d0f14c34a785bfd Mon Sep 17 00:00:00 2001 From: tiyn Date: Sat, 3 Sep 2022 14:13:54 +0200 Subject: [PATCH 6/6] nvim: changed plugins to lowercase --- .config/nvim/init.vim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim index 4bf4201..4df8766 100644 --- a/.config/nvim/init.vim +++ b/.config/nvim/init.vim @@ -19,23 +19,23 @@ Plug 'hrsh7th/nvim-cmp' " autocompletion Plug 'hrsh7th/cmp-nvim-lsp' " autocompletion bridge to lsp Plug 'itchyny/lightline.vim' " fancy statusline Plug 'junegunn/fzf.vim' " quickly jump files using fzf -Plug 'L3MON4D3/LuaSnip' " Snippet support +Plug 'l3mon4d3/luasnip' " snippet support Plug 'luochen1990/rainbow' " colorized matching brackets Plug 'majutsushi/tagbar', {'on': 'TagbarToggle'} " show tags -Plug 'mattesgroeger/vim-bookmarks' " Set Bookmarks +Plug 'mattesgroeger/vim-bookmarks' " Set bookmarks Plug 'neovim/nvim-lspconfig' " Language server client Plug 'onsails/lspkind-nvim' " icons on completion Plug 'qpkorr/vim-renamer' " bulk renamer Plug 'raimondi/delimitmate' " automatic closing of brackets Plug 'rrethy/vim-hexokinase' , {'do': 'make hexokinase'} " color Preview Plug 'ryanoasis/vim-devicons' " enable icons for vim -Plug 'saadparwaiz1/cmp_luasnip' " Add luasnips to cmp +Plug 'saadparwaiz1/cmp_luasnip' " add snippets from luasnips to cmp Plug 'scrooloose/nerdtree', {'on': 'NERDTreeToggle'} " filetree Plug 'tiyn/vim-tccs' " custom colorscheme Plug 'tpope/vim-fugitive' " git wrapper Plug 'tpope/vim-surround' " help for quotes/parantheses Plug 'uiiaoo/java-syntax.vim' , {'for': 'java'} " better syntax highlight for java than default -Plug 'zah/nim.vim' , {'for': 'nim'} " Highlighting for nim +Plug 'zah/nim.vim' , {'for': 'nim'} " highlighting for nim call plug#end() " alvan/vim-closetag