diff --git a/config/gtk-3.0/settings.ini b/config/gtk-3.0/settings.ini index 880b45f..fd39876 100644 --- a/config/gtk-3.0/settings.ini +++ b/config/gtk-3.0/settings.ini @@ -1,4 +1,4 @@ [Settings] -gtk-icon-theme-name = breeze-dark -gtk-theme-name = Midnight-Blue +gtk-icon-theme-name = Material-Black-Lime-Numix +gtk-theme-name = Material-Black-Lime gtk-application-prefer-dark-theme = true diff --git a/config/nvim/init.vim b/config/nvim/init.vim index 67f04ed..da2fecc 100644 --- a/config/nvim/init.vim +++ b/config/nvim/init.vim @@ -18,8 +18,9 @@ filetype indent off hi Whitespace ctermfg=233 hi SignColumn ctermbg=233 +nnoremap :set et:set ts=4:set sw=4 +nnoremap :set noet:set ts=8:set sw=8 nnoremap :set list! -nnoremap :!sample-compile-flags noremap - ddp nnoremap _ ddkP @@ -37,14 +38,7 @@ vnoremap " a"``> nnoremap H 0 nnoremap L $ " auto indent -nnoremap gg=G - -" Used in abbrevs to remove a space -" append: =Eatchar('\s') -func Eatchar(pat) - let c = nr2char(getchar(0)) - return (c =~ a:pat) ? '' : c -endfunc +"vnoremap :lua vim.lsp.buf.range_formatting() call plug#begin('~/.config/nvim/plugged') @@ -65,7 +59,7 @@ Plug 'drmingdrmer/xptemplate' call plug#end() -nnoremap :silent NERDTreeToggle +nnoremap silent NERDTreeToggle augroup nerdtree " Exit Vim if NERDTree is the only window remaining in the only tab. @@ -107,29 +101,50 @@ require'compe'.setup { --- IMPORTANT vim.api.nvim_set_keymap('i', '', 'compe#confirm("")', { expr = true }) ---- LSP -local nvim_lsp = require('lspconfig') - --- Use an on_attach function to only map the following keys --- after the language server attaches to the current buffer -local on_attach = function(client, bufnr) +local common_bindings = function(client, bufnr) local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end --Enable completion triggered by buf_set_option('omnifunc', 'v:lua.vim.lsp.omnifunc') end --- Use a loop to conveniently call 'setup' on multiple servers and --- map buffer local keybindings when the language server attaches -local servers = { 'pylsp', 'clangd', 'rls', 'tsserver' } -for _, lsp in ipairs(servers) do +local default_formatting = function(client, bufnr) + local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end + + local opts = { noremap=true, silent=true } + + buf_set_keymap('n', 'f', 'lua vim.lsp.buf.formatting()', opts) +end + +local default_attach = function(client, bufnr) + common_bindings(client, bufnr) + default_formatting(client, bufnr) +end + + +local setup = function(lsp, on_attach, options) + local nvim_lsp = require('lspconfig') + nvim_lsp[lsp].setup { on_attach = on_attach, flags = { debounce_text_changes = 150, - } + }, + options=options } end + +-- Use a loop to conveniently call 'setup' on multiple servers and +-- map buffer local keybindings when the language server attaches +local servers = { 'pylsp', 'clangd', 'rls', 'tsserver' } +for _, lsp in ipairs(servers) do + setup(lsp, default_attach) +end + +-- Servers with custom setup + +-- placeholder + EOF " auto close scratch buffer (preview window) diff --git a/home/aliases b/home/aliases index 54c75fd..c773819 100644 --- a/home/aliases +++ b/home/aliases @@ -1,26 +1,44 @@ export PATH="$HOME/.local/bin:$PATH" export EDITOR="/usr/bin/nvim" -#vim +# vim alias vim="nvim" -#ls +# ls alias ls="ls --color=auto" alias ..="cd .." alias ...="cd ../.." alias ....="cd ../../.." alias .....="cd ../../../.." +alias ......="cd ../../../../.." +alias .......="cd ../../../../../.." # improved reset and clear alias reset="tput reset" alias clear="tput reset" # better du -alias du="du -h" +alias du="du -hd 1" -#better feh +# better feh alias feh="feh -." -#vi keybindings +# vi keybindings alias info="info --vi-keys" + +# grepa +alias grepa="grep -n --color=always -r --exclude-dir=venv" + +# less +alias less="less -R" + +# find +alias find="find -name" + +# sl +alias sl="ls" + +finder() { + grepa "$1" | less +} diff --git a/home/gtkrc-2.0 b/home/gtkrc-2.0 index d96f857..4977dfa 100644 --- a/home/gtkrc-2.0 +++ b/home/gtkrc-2.0 @@ -1,3 +1,3 @@ -gtk-icon-theme-name = "breeze-dark" -gtk-theme-name = "Midnight-Blue" +gtk-icon-theme-name = "Material-Black-Cherry" +gtk-theme-name = "Material-Black-Cherry" gtk-application-prefer-dark-theme = "true"