From 803c35ca38c2e0783126d2e027fd8b1107c56a11 Mon Sep 17 00:00:00 2001 From: Marco Thomas Date: Mon, 23 Nov 2020 18:14:02 +0100 Subject: [PATCH] Update dots --- files/.config/i3/config | 7 +- files/.config/nvim/lua/marc/completion.lua | 44 +++++++++++ files/.config/nvim/lua/marc/lsp.lua | 24 ++++++ files/.config/polybar/config | 3 +- files/.vimrc | 85 ++-------------------- files/.zshrc | 5 +- 6 files changed, 85 insertions(+), 83 deletions(-) create mode 100644 files/.config/nvim/lua/marc/completion.lua create mode 100644 files/.config/nvim/lua/marc/lsp.lua diff --git a/files/.config/i3/config b/files/.config/i3/config index c9f2c4e..39d2a99 100644 --- a/files/.config/i3/config +++ b/files/.config/i3/config @@ -11,7 +11,7 @@ set $mod Mod4 floating_modifier $mod # Font for Window Titles -font pango:Product Sans 8 +font pango:Product Sans 10 # ============================== Keybinds (except workspaces) #Terminal @@ -79,6 +79,7 @@ bindsym $mod+e exec thunar bindsym $mod+Ctrl+c exec google-calendar-dark bindsym $mod+Ctrl+d exec discord; exec Discord +bindsym $mod+Ctrl+Shift+d exec pkill discord; exec pkill Discord bindsym $mod+Ctrl+f exec firefox bindsym $mod+Ctrl+m exec thunderbird bindsym $mod+Ctrl+n exec notion-app @@ -156,8 +157,8 @@ set $border "#98c379" # Class Border Backgr. Text Indic. Child_border client.focused $border $border #000000 $border $border -client.focused_inactive $termbg $termbg $border $termbg $termbg -client.unfocused $termbg $termbg $border $termbg $termbg +client.focused_inactive $border $termbg #ffffff $termbg $termbg +client.unfocused $termbg $termbg #ffffff $termbg $termbg client.urgent $red $red $border $red $red client.background $border diff --git a/files/.config/nvim/lua/marc/completion.lua b/files/.config/nvim/lua/marc/completion.lua new file mode 100644 index 0000000..c1b8ca9 --- /dev/null +++ b/files/.config/nvim/lua/marc/completion.lua @@ -0,0 +1,44 @@ +-- TODO: Migrate this to https://github.com/neovim/neovim/pull/12378 once merged +vim.cmd("autocmd BufEnter * lua require'completion'.on_attach()") + +-- Use and to navigate through popup menu +vim.api.nvim_set_keymap("i", "", "pumvisible() ? \"\\\" : \"\\\"", { noremap = true }) +vim.api.nvim_set_keymap("i", "", "pumvisible() ? \"\\\" : \"\\\"", { noremap = true }) + +vim.api.nvim_set_option("completeopt", "menuone,noinsert,noselect") + +-- Default + c to avoid showing extra messages when using completion +vim.api.nvim_set_option("shortmess", "filnxtToOFc") + +-- Trigger instantly +vim.api.nvim_set_var("completion_trigger_keyword_length", 1) + +-- Ignore case for matching +vim.api.nvim_set_var("completion_matching_ignore_case", 1) + +-- Also trigger completion on delete +vim.api.nvim_set_var("completion_trigger_on_delete", 1) + +-- Use Neosnippet as snippet provider +vim.api.nvim_set_var("completion_enable_snippet", 'Neosnippet') + +-- Neosnippet expansion bindings +vim.api.nvim_set_keymap("i", "", "(neosnippet_expand_or_jump)", {}) +vim.api.nvim_set_keymap("s", "", "(neosnippet_expand_or_jump)", {}) +vim.api.nvim_set_keymap("x", "", "(neosnippet_expand_target)", {}) + +-- Always do smart case matching +vim.api.nvim_set_var("g:completion_matching_smart_case", 1) + +vim.api.nvim_set_var("completion_chain_complete_list", { + default = { + default = { + {complete_items= {'lsp','snippet','path'}}, + {mode= ''}, + {mode= ''}}, + } + } +) + +-- Limit the amount of completion suggestions to 10 +vim.api.nvim_set_option("pumheight", 10) diff --git a/files/.config/nvim/lua/marc/lsp.lua b/files/.config/nvim/lua/marc/lsp.lua new file mode 100644 index 0000000..42bd73a --- /dev/null +++ b/files/.config/nvim/lua/marc/lsp.lua @@ -0,0 +1,24 @@ +if vim.api.nvim_eval("executable('pyls')") then + require'lspconfig'.pyls.setup{} +end + +if vim.api.nvim_eval("executable('rust-analyzer')") then + require'lspconfig'.rust_analyzer.setup{} +end + +if vim.api.nvim_eval("executable('texlab')") then + require'lspconfig'.texlab.setup{} +end + +if vim.api.nvim_eval("isdirectory($HOME. '/.cache/nvim/lspconfig/jdtls')") then + require'lspconfig'.jdtls.setup{} +end + +-- g(o) d(efinition) +vim.api.nvim_set_keymap("n", "gd" , "lua vim.lsp.buf.definition()", { noremap = true, silent = true }) +-- g(o) r(eference) +vim.api.nvim_set_keymap("n", "gr" , "lua vim.lsp.buf.references()", { noremap = true, silent = true }) +-- K for hover information +vim.api.nvim_set_keymap("n", "K" , "lua vim.lsp.buf.hover()", { noremap = true, silent = true }) +-- s(how) d(iagnostics) +vim.api.nvim_set_keymap("n", "sd", "lua vim.lsp.diagnostic.set_loclist()", { noremap = true}) diff --git a/files/.config/polybar/config b/files/.config/polybar/config index 8de7b02..4499490 100644 --- a/files/.config/polybar/config +++ b/files/.config/polybar/config @@ -74,7 +74,7 @@ ws-icon-8 = 9;九 ws-icon-9 = 10;十 label-focused = "%icon%" -label-focused-foreground = ${colors.accent} +label-focused-foreground = ${colors.accent-alt} label-focused-padding = 2 label-unfocused = "%icon%" @@ -85,6 +85,7 @@ label-visible-padding = 2 label-urgent = "%icon%" label-urgent-background = ${colors.urgent} +label-urgent-foreground = ${colors.background} label-urgent-padding = 2 label-mode = "%mode%" diff --git a/files/.vimrc b/files/.vimrc index fea0bf9..c447697 100644 --- a/files/.vimrc +++ b/files/.vimrc @@ -37,15 +37,15 @@ endif call plug#end() -""" ============================== Colors +" ============================== Colors syntax on set background=dark colorscheme onedark hi Normal ctermbg=NONE guibg=NONE set termguicolors -filetype indent plugin on " ============================== General +filetype indent plugin on set number set relativenumber set cursorline @@ -127,82 +127,13 @@ cmap W w cmap q1 q! " fzf -nmap :Files +nmap ff :Files +nmap ft :tabe:Files -" ============================== LSP - -" ---------- completion-nvim Settings +" ============================== Cool NeoVim Shit if has ("nvim") - " Use completion-nvim in every buffer - autocmd BufEnter * lua require'completion'.on_attach() + " setup lsp configs + lua require'marc.lsp' - " Use and to navigate through popup menu - inoremap pumvisible() ? "\" : "\" - inoremap pumvisible() ? "\" : "\" - - " Set completeopt to have a better completion experience - set completeopt=menuone,noinsert,noselect - - " Avoid showing message extra message when using completion - set shortmess+=c - - let g:completion_trigger_keyword_length = 1 - let g:completion_matching_ignore_case = 1 - let g:completion_trigger_on_delete = 1 - - let g:completion_enable_snippet = 'Neosnippet' - - let g:completion_chain_complete_list = { - \ 'default' : { - \ 'default': [ - \ {'complete_items': ['lsp', 'snippet', 'path']}, - \ {'mode': ''}, - \ {'mode': ''}], - \ } - \} - - set pumheight=10 -endif - -" ---------- lsp Settings -if has ("nvim") - " Show definition - nnoremap gd lua vim.lsp.buf.definition() - " Go to references - nnoremap gr lua vim.lsp.buf.references() - nnoremap K lua vim.lsp.buf.hover() -endif - -" ---------- neosnippet Settings -if has ("nvim") - imap (neosnippet_expand_or_jump) - smap (neosnippet_expand_or_jump) - xmap (neosnippet_expand_target) -endif - -" ---------- Enable Language Servers -if has ("nvim") - if executable("pyls") - lua << EOF - require'nvim_lsp'.pyls.setup{} -EOF - endif - - if executable("rust-analyzer") - lua << EOF - require'nvim_lsp'.rust_analyzer.setup{} -EOF - endif - - if executable("texlab") - lua << EOF - require'nvim_lsp'.texlab.setup{} -EOF - endif - - if isdirectory($HOME. "/.cache/nvim/nvim_lsp/jdtls") - lua << EOF - require'nvim_lsp'.jdtls.setup{} -EOF - endif + lua require'marc.completion' endif diff --git a/files/.zshrc b/files/.zshrc index 6a343d4..c91521e 100644 --- a/files/.zshrc +++ b/files/.zshrc @@ -38,9 +38,10 @@ export PATH=$PATH:$HOME/.local/bin:$HOME/scripts:$HOME/.cargo/bin alias fontslist="fc-list :scalable=true:spacing=mono: family" alias fontscache="fc-cache -f -v" -if [[ -x $(which nvim 2> /dev/null) ]]; then +#if [[ -x $(which nvim 2> /dev/null) ]]; then alias vim="nvim" -fi + alias vim="~/neovim-nightly/bin/nvim" +#fi # im either using manjaro or fedora if [[ -f "/etc/manjaro-release" ]]; then