diff --git a/fzf-marks b/fzf-marks index 31eac10..5b4ed4f 100644 --- a/fzf-marks +++ b/fzf-marks @@ -9,13 +9,13 @@ xresources : /home/corpse/.config/X11/xresources polybar : /home/corpse/.config/polybar/config correo : /home/corpse/.config/neomutt keys : /home/corpse/.config/sxhkd/sxhkdrc -tmux : /home/corpse/.config/tmux/tmux.conf mpv : /home/corpse/.config/mpv/mpv.conf xinit : /home/corpse/.config/X11/xinitrc -zshenv : /home/corpse/.zshenv bspwm : /home/corpse/.config/bspwm/bspwmrc -nvim : /home/corpse/.config/nvim terminal : /home/corpse/.config/alacritty.yml zsh : /home/corpse/.config/zsh +zshenv : /home/corpse/.zshenv lf : /home/corpse/.config/lf/lfrc +tmux : /home/corpse/.config/tmux/tmux.conf +nvim : /home/corpse/.config/nvim alias : /home/corpse/.config/zsh/conf/03_aliases.zsh diff --git a/gtk-2.0/gtkrc-2.0 b/gtk-2.0/gtkrc-2.0 index e8a8bea..8cbfa72 100644 --- a/gtk-2.0/gtkrc-2.0 +++ b/gtk-2.0/gtkrc-2.0 @@ -2,7 +2,7 @@ # Any customization should be done in ~/.gtkrc-2.0.mine instead. include "/home/corpse/.gtkrc-2.0.mine" -gtk-theme-name="pho-earth-by-night" +gtk-theme-name="Skeuos-Black-Dark" gtk-icon-theme-name="BluecurveRH" gtk-font-name="System Charcoal 10" gtk-cursor-theme-name="Grounation" diff --git a/gtk-3.0/settings.ini b/gtk-3.0/settings.ini index 18c240a..66f110f 100644 --- a/gtk-3.0/settings.ini +++ b/gtk-3.0/settings.ini @@ -1,6 +1,6 @@ [Settings] gtk-application-prefer-dark-theme=1 -gtk-theme-name=pho-earth-by-night +gtk-theme-name=Skeuos-Black-Dark gtk-icon-theme-name=BluecurveRH gtk-font-name=System Charcoal 10 gtk-cursor-theme-size=0 diff --git a/lf/lfrc b/lf/lfrc index ab69e9a..3c3e315 100644 --- a/lf/lfrc +++ b/lf/lfrc @@ -33,23 +33,22 @@ cmd open ${{ esac }} -cmd bulk-rename ${{ - old="$(mktemp)" - new="$(mktemp)" - [ -n "$fs" ] && fs="$(ls)" - printf '%s\n' "$fs" >"$old" - printf '%s\n' "$fs" >"$new" - $EDITOR "$new" - [ "$(wc -l < "$new")" -ne "$(wc -l < "$old")" ] && exit - paste "$old" "$new" | while IFS= read -r names; do - src="$(printf '%s' "$names" | cut -f1)" - dst="$(printf '%s' "$names" | cut -f2)" - if [ "$src" = "$dst" ] || [ -e "$dst" ]; then - continue - fi - mv -- "$src" "$dst" +cmd bulkrename ${{ + old=$(mktemp) + new=$(mktemp) + [ -n $fs ] && fs=$(ls) + printf "$fs\n" > $old + printf "$fs\n" > $new + $EDITOR $new + [ $(cat $new | wc -l) -ne $(cat $old | wc -l) ] && exit + paste $old $new | while read names; do + src=$(printf $names | cut -f1) + dst=$(printf $names | cut -f2) + [ $src = $dst ] && continue + [ -e $dst ] && continue + mv $src $dst done - rm -- "$old" "$new" + rm $old $new lf -remote "send $id unselect" }} diff --git a/mangadesk/config.json b/mangadesk/config.json new file mode 100755 index 0000000..7555b26 --- /dev/null +++ b/mangadesk/config.json @@ -0,0 +1,10 @@ +{ + "downloadDir": "/mnt/wd1tb/catacombs/img/comics/", + "languages": [ + "en" + ], + "downloadQuality": "data", + "forcePort443": false, + "asZip": true, + "zipType": "cbz" +} \ No newline at end of file diff --git a/nvim/after/ftplugin/css.vim b/nvim/after/ftplugin/css.vim index 890c007..f3d08fd 100644 --- a/nvim/after/ftplugin/css.vim +++ b/nvim/after/ftplugin/css.vim @@ -1,12 +1,5 @@ setlocal expandtab setlocal shiftwidth=2 setlocal softtabstop=2 -setlocal smartindent -lua require'cmp'.setup.buffer { -\ sources = { -\ { name = 'nvim_lsp' }, -\ { name = 'luasnip' }, -\ { name = 'buffer' }, -\ }, -\ } +lua require('cmp').setup.buffer({ sources = {{ name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'buffer' }}}) diff --git a/nvim/after/ftplugin/go.vim b/nvim/after/ftplugin/go.vim index 905651c..6b6dad3 100644 --- a/nvim/after/ftplugin/go.vim +++ b/nvim/after/ftplugin/go.vim @@ -3,42 +3,4 @@ setlocal shiftwidth=4 setlocal tabstop=4 setlocal foldmethod=syntax -let g:go_textobj_include_function_doc = 1 -let g:go_auto_type_info = 1 -let g:go_auto_sameids = 1 -let g:go_autodetect_gopath = 1 -let g:go_imports_autosave = 1 -let g:go_doc_popup_window = 1 -let g:go_gopls_enabled = 1 -let g:go_metalinter_autosave = 1 -let g:go_fmt_command = "goimports" -let g:go_list_type = "quickfix" - -" Go syntax highlighting -let g:go_highlight_build_constraints = 1 -let g:go_highlight_fields = 1 -let g:go_highlight_function_calls = 1 -let g:go_highlight_functions = 1 -let g:go_highlight_methods = 1 -let g:go_highlight_operators = 1 -let g:go_highlight_structs = 1 -let g:go_highlight_types = 1 -let g:go_highlight_extra_types = 1 -let g:go_play_browser_command = 'tmux new-window elinks %URL%' - -" Status line types/signatures -let g:go_auto_type_info = 1 - -" Add the failing test name to the output of :GoTest -let g:go_test_show_name = 1 - -inoremap . . -nmap d :(go-def) -nmap t :GoTest! -nmap b :GoBuild! -nmap i :GoInstall! -nmap R :GoRun % -nmap x :GoDebugStart! -nmap r :GoRun! -nmap m :GoDoc -nmap D :GoDocBrowser +lua require('cmp').setup.buffer({sources = {{name = 'nvim_lsp' }, {name = 'luasnip'}, { name = 'buffer' }}}) diff --git a/nvim/after/ftplugin/html.vim b/nvim/after/ftplugin/html.vim index 3ecb905..2470d61 100644 --- a/nvim/after/ftplugin/html.vim +++ b/nvim/after/ftplugin/html.vim @@ -1,23 +1,16 @@ setlocal expandtab setlocal shiftwidth=2 setlocal softtabstop=2 -setlocal smartindent -let g:html_indent_script1 = "auto" -let g:html_indent_style1 = "auto" +" let g:html_indent_script1 = "auto" +" let g:html_indent_style1 = "auto" +" +" if &completeopt =~# '.*noselect.*' +" iabbrev +" imap +" imap > > +" else +" iabbrev +" endif -if &completeopt =~# '.*noselect.*' - iabbrev - imap - imap > > -else - iabbrev -endif - -lua require'cmp'.setup.buffer { -\ sources = { -\ { name = 'nvim_lsp' }, -\ { name = 'luasnip' }, -\ { name = 'buffer' }, -\ }, -\ } +lua require('cmp').setup.buffer({ sources = {{ name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'buffer' }}}) diff --git a/nvim/after/ftplugin/lua.vim b/nvim/after/ftplugin/lua.vim index cc50ff1..610f00b 100644 --- a/nvim/after/ftplugin/lua.vim +++ b/nvim/after/ftplugin/lua.vim @@ -1,11 +1,5 @@ -lua require'cmp'.setup.buffer { -\ sources = { -\ { name = 'nvim_lsp' }, -\ { name = 'nvim_lua' }, -\ { name = 'luasnip' }, -\ { name = 'buffer' }, -\ }, -\ } +lua require('cmp').setup.buffer({ sources = { { name = 'nvim_lsp' }, { name = 'luasnip' }, { name = 'buffer' }}}) set shiftwidth=2 set tabstop=2 +setlocal textwidth=120 diff --git a/nvim/after/ftplugin/markdown.vim b/nvim/after/ftplugin/markdown.vim new file mode 100644 index 0000000..fd8063f --- /dev/null +++ b/nvim/after/ftplugin/markdown.vim @@ -0,0 +1,3 @@ +setlocal spell + +lua require('cmp').setup.buffer({sources = {{name = 'spell'}, {name = 'nvim_lsp' }, {name = 'luasnip'}}}) diff --git a/nvim/after/ftplugin/text.vim b/nvim/after/ftplugin/text.vim index 2d0495d..c3f2a76 100644 --- a/nvim/after/ftplugin/text.vim +++ b/nvim/after/ftplugin/text.vim @@ -16,9 +16,4 @@ nnoremap z=1 nnoremap zg inoremap u[s1z=`]au -lua require'cmp'.setup.buffer { -\ sources = { -\ { name = 'buffer' }, -\ { name = 'spell' } -\ }, -\ } +lua require'cmp'.setup.buffer({sources = {{ name = 'spell' }}}) diff --git a/nvim/after/ftplugin/vim.vim b/nvim/after/ftplugin/vim.vim index 49d5ba4..53b457a 100644 --- a/nvim/after/ftplugin/vim.vim +++ b/nvim/after/ftplugin/vim.vim @@ -1,10 +1,4 @@ -lua require'cmp'.setup.buffer { -\ sources = { -\ { name = 'nvim_lsp' }, -\ { name = 'luasnip' }, -\ { name = 'buffer' }, -\ }, -\ } +lua require'cmp'.setup.buffer({ sources = {{ name = 'nvim_lsp' }, { name = 'nvim_lua' }, { name = 'luasnip' }, { name = 'buffer' }}}) set shiftwidth=2 set tabstop=2 diff --git a/nvim/after/plugin/grep.vim b/nvim/after/plugin/grep.vim new file mode 100644 index 0000000..f99c650 --- /dev/null +++ b/nvim/after/plugin/grep.vim @@ -0,0 +1,4 @@ +if executable("rg") + set grepprg=rg\ --vimgrep\ --no-heading + set grepformat=%f:%l:%c:%m,%f:%l:%m +endif diff --git a/nvim/after/plugin/loupe.vim b/nvim/after/plugin/loupe.vim new file mode 100644 index 0000000..4635c7f --- /dev/null +++ b/nvim/after/plugin/loupe.vim @@ -0,0 +1,6 @@ +let g:LoupeClearHighlightMap = 1 +let g:LoupeCenterResults=0 +set shortmess-=s +nmap (LoupeN) +nmap (Loupen) + diff --git a/nvim/after/syntax/gomod.vim b/nvim/after/syntax/gomod.vim new file mode 100644 index 0000000..7dcef1a --- /dev/null +++ b/nvim/after/syntax/gomod.vim @@ -0,0 +1,92 @@ +" gomod.vim: Vim syntax file for go.mod file +" +" Quit when a (custom) syntax file was already loaded +if exists("b:current_syntax") + finish +endif + +syntax case match + +" match keywords +syntax keyword gomodModule module +syntax keyword gomodGo go contained +syntax keyword gomodRequire require +syntax keyword gomodExclude exclude +syntax keyword gomodReplace replace + +" require, exclude, replace, and go can be also grouped into block +syntax region gomodRequire start='require (' end=')' transparent contains=gomodRequire,gomodVersion +syntax region gomodExclude start='exclude (' end=')' transparent contains=gomodExclude,gomodVersion +syntax region gomodReplace start='replace (' end=')' transparent contains=gomodReplace,gomodVersion +syntax match gomodGo '^go .*$' transparent contains=gomodGo,gomodGoVersion + +" set highlights +highlight default link gomodModule Keyword +highlight default link gomodGo Keyword +highlight default link gomodRequire Keyword +highlight default link gomodExclude Keyword +highlight default link gomodReplace Keyword + +" comments are always in form of // ... +syntax region gomodComment start="//" end="$" contains=@Spell +highlight default link gomodComment Comment + +" make sure quoted import paths are higlighted +syntax region gomodString start=+"+ skip=+\\\\\|\\"+ end=+"+ +highlight default link gomodString String + +" replace operator is in the form of '=>' +syntax match gomodReplaceOperator "\v\=\>" +highlight default link gomodReplaceOperator Operator + +" match go versions +syntax match gomodGoVersion "1\.\d\+" contained +highlight default link gomodGoVersion Identifier + + +" highlight versions: +" * vX.Y.Z-pre +" * vX.Y.Z +" * vX.0.0-yyyyymmddhhmmss-abcdefabcdef +" * vX.Y.Z-pre.0.yyyymmddhhmmss-abcdefabcdef +" * vX.Y.(Z+1)-0.yyyymmddhhss-abcdefabcdef +" see https://godoc.org/golang.org/x/tools/internal/semver for more +" information about how semantic versions are parsed and +" https://golang.org/cmd/go/ for how pseudo-versions and +incompatible +" are applied. + + +" match vX.Y.Z and their prereleases +syntax match gomodVersion "v\d\+\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?" +" ^--- version ---^^------------ pre-release ---------------------^^--------------- metadata ---------------------^ +" ^--------------------------------------- semantic version -------------------------------------------------------^ + +" match pseudo versions +" without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef) +syntax match gomodVersion "v\d\+\.0\.0-\d\{14\}-\x\+" +" when most recent version before target is a pre-release +syntax match gomodVersion "v\d\+\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\+" +" ^--- version ---^^--- ------ pre-release -----------------^^--------------- metadata ---------------------^ +" ^------------------------------------- semantic version --------------------------------------------------^ +" most recent version before the target is X.Y.Z +syntax match gomodVersion "v\d\+\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\+" +" ^--- version ---^^--------------- metadata ---------------------^ + +" match incompatible vX.Y.Z and their prereleases +syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?+incompatible" +" ^------- version -------^^------------- pre-release ---------------------^^--------------- metadata ---------------------^ +" ^------------------------------------------- semantic version -----------------------------------------------------------^ + +" match incompatible pseudo versions +" incompatible without a major version before the commit (e.g. vX.0.0-yyyymmddhhmmss-abcdefabcdef) +syntax match gomodVersion "v[2-9]\{1}\d*\.0\.0-\d\{14\}-\x\++incompatible" +" when most recent version before target is a pre-release +syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+-\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\%(+\%([0-9A-Za-z-]\+\)\(\.[0-9A-Za-z-]\+\)*\)\?\.0\.\d\{14}-\x\++incompatible" +" ^------- version -------^^---------- pre-release -----------------^^--------------- metadata ---------------------^ +" ^---------------------------------------- semantic version ------------------------------------------------------^ +" most recent version before the target is X.Y.Z +syntax match gomodVersion "v[2-9]\{1}\d*\.\d\+\.\d\+\%(+\%([0-9A-Za-z-]\+\)\%(\.[0-9A-Za-z-]\+\)*\)\?-0\.\d\{14}-\x\++incompatible" +" ^------- version -------^^---------------- metadata ---------------------^ +highlight default link gomodVersion Identifier + +let b:current_syntax = "gomod" diff --git a/nvim/ftdetect/gofiletype.vim b/nvim/ftdetect/gofiletype.vim new file mode 100644 index 0000000..0f5b9aa --- /dev/null +++ b/nvim/ftdetect/gofiletype.vim @@ -0,0 +1,33 @@ +" +" vim-go/ftdetect/gofiletype.vim +" + +" Note: should not use augroup in ftdetect (see :help ftdetect) +au BufRead,BufNewFile *.go setfiletype go +au BufRead,BufNewFile *.s setfiletype asm +au BufRead,BufNewFile *.tmpl setfiletype gohtmltmpl +au BufRead,BufNewFile go.sum set filetype=gosum + +" remove the autocommands for modsim3, and lprolog files so that their +" highlight groups, syntax, etc. will not be loaded. *.MOD is included, so +" that on case insensitive file systems the module2 autocmds will not be +" executed. +au! BufRead,BufNewFile *.mod,*.MOD +" Set the filetype if the first non-comment and non-blank line starts with +" 'module '. +au BufRead,BufNewFile go.mod call s:gomod() + +fun! s:gomod() + for l:i in range(1, line('$')) + let l:l = getline(l:i) + if l:l ==# '' || l:l[:1] ==# '//' + continue + endif + + if l:l =~# '^module .\+' + setfiletype gomod + endif + + break + endfor +endfun diff --git a/nvim/init.lua b/nvim/init.lua new file mode 100644 index 0000000..1c55922 --- /dev/null +++ b/nvim/init.lua @@ -0,0 +1,64 @@ +vim.g.mapleader = ' ' +vim.g.maplocalleader = ',' +vim.o.termguicolors = true + +local execute = vim.api.nvim_command +local fn = vim.fn +local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim' +if fn.empty(fn.glob(install_path)) > 0 then + fn.system({'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path}) + execute 'packadd packer.nvim' +end + +require('packer').startup({function(use) + use 'wbthomason/packer.nvim' + use({ 'lewis6991/impatient.nvim', + config = function() + require('impatient') + end +}) +use { 'neovim/nvim-lspconfig', requires = {'ray-x/lsp_signature.nvim'}, config = [[ require('plugins/lspconfig') ]] } +use { 'hrsh7th/nvim-cmp', +requires = { + "hrsh7th/cmp-nvim-lsp", + "hrsh7th/cmp-nvim-lua", + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "saadparwaiz1/cmp_luasnip", +}, +config = [[ require('plugins/cmp') ]], + } + use { 'L3MON4D3/LuaSnip', requires = { "rafamadriz/friendly-snippets", }} + use { 'windwp/nvim-autopairs', config = [[ require('plugins/autopairs') ]] } + use { 'nvim-telescope/telescope.nvim', + requires = { + {'nvim-lua/plenary.nvim', opt = true,}, + {'nvim-telescope/telescope-fzf-native.nvim', opt = true, run = 'make' } + }, + config = [[ require('plugins/telescope') ]], +} +use { 'nvim-treesitter/nvim-treesitter', run = ':TSUpdate', config = [[ require('plugins/treesitter') ]] } +use { 'ellisonleao/gruvbox.nvim', requires = {'rktjmp/lush.nvim', opt = true}, } +use { 'kyazdani42/nvim-web-devicons', after = 'gruvbox.nvim', config = [[ require('plugins/webdevicons_nvim') ]] } +use { 'numToStr/Comment.nvim', require('Comment').setup() } +use { 'norcalli/nvim-colorizer.lua', config = [[ require('plugins/colorizer') ]] } +use { 'tpope/vim-fugitive', opt = true, cmd = { "Git", "Gdiff", "Gblame", "Glog", "Git mergetool" }, } +use { 'lewis6991/gitsigns.nvim', event = { "BufRead", "BufNewFile" }, requires = { 'nvim-lua/plenary.nvim', opt = true, }, config = [[ require('plugins/gitsigns_nvim') ]] } +use { + "folke/lsp-trouble.nvim", + config = function() + require("trouble").setup() + end, + cmd = { "LspTrouble" }, + requires = "kyazdani42/nvim-web-devicons", +} +end, +config = { + compile_path = vim.fn.stdpath('config')..'/lua/packer_compiled.lua', + display = { + open_fn = function() + return require('packer.util').float({ border = 'single' }) + end + } +}}) +require('packer_compiled') diff --git a/nvim/init.vim b/nvim/init.vim deleted file mode 100644 index 7c0b242..0000000 --- a/nvim/init.vim +++ /dev/null @@ -1,41 +0,0 @@ -let mapleader="\" -let maplocalleader=',' - -if empty(glob('~/.local/share/nvim/site/autoload/plug.vim')) - silent !curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs - \ https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim - aug Plugins - au! - au VimEnter * PlugInstall --sync | source $MYVIMRC - aug END -endif -if filereadable(expand('~/.local/share/nvim/site/autoload/plug.vim')) - call plug#begin(stdpath('data') . '/plugged') - Plug 'nvim-lua/plenary.nvim' - Plug 'rafamadriz/friendly-snippets' - Plug 'tpope/vim-fugitive' - Plug 'windwp/nvim-autopairs' - Plug 'lewis6991/gitsigns.nvim' - Plug 'hrsh7th/nvim-cmp' - Plug 'hrsh7th/cmp-buffer' - Plug 'hrsh7th/cmp-nvim-lua' - Plug 'hrsh7th/cmp-nvim-lsp' - Plug 'saadparwaiz1/cmp_luasnip' - Plug 'f3fora/cmp-spell' - Plug 'L3MON4D3/LuaSnip' - Plug 'neovim/nvim-lspconfig' - Plug 'ray-x/lsp_signature.nvim' - Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'} - Plug 'p00f/nvim-ts-rainbow' - Plug 'nvim-telescope/telescope.nvim' - Plug 'nvim-telescope/telescope-fzf-native.nvim', { 'do': 'make' } - Plug 'ellisonleao/gruvbox.nvim' - Plug 'kyazdani42/nvim-web-devicons' - call plug#end() -endif -lua require('Comment').setup() -set termguicolors -colorscheme gruvbox -hi! Normal ctermbg=NONE guibg=NONE -hi! NonText ctermbg=NONE guibg=NONE guifg=NONE ctermfg=NONE -hi! SignColumn ctermbg=NONE guibg=NONE guifg=NONE ctermfg=NONE diff --git a/nvim/plugin/pares.lua b/nvim/lua/plugins/autopairs.lua similarity index 81% rename from nvim/plugin/pares.lua rename to nvim/lua/plugins/autopairs.lua index be3e7cb..767939a 100644 --- a/nvim/plugin/pares.lua +++ b/nvim/lua/plugins/autopairs.lua @@ -1,10 +1,14 @@ -require('nvim-autopairs').setup{ +require('nvim-autopairs').setup({ check_ts = true, ts_config = { lua = {'string'},-- it will not add pair on that treesitter node javascript = {'template_string'}, - } -} + }, + enable_check_bracket_line = true, -- Don't add pairs if it already have a close pairs in same line + disable_filetype = { "TelescopePrompt" , "vim" }, -- + enable_afterquote = false, -- add bracket pairs after quote + enable_moveright = true +}) local Rule = require('nvim-autopairs.rule') require('nvim-autopairs').add_rules({ @@ -40,8 +44,7 @@ require('nvim-autopairs').add_rules({ :set_end_pair_length(2), }) -require("nvim-autopairs.completion.cmp").setup({ - map_cr = true, -- map on insert mode +require("cmp").setup({ map_complete = true, -- it will auto insert `(` (map_char) after select function or method item auto_select = true, -- automatically select the first item insert = false, -- use insert confirm behavior instead of replace diff --git a/nvim/plugin/completar.lua b/nvim/lua/plugins/cmp.lua similarity index 66% rename from nvim/plugin/completar.lua rename to nvim/lua/plugins/cmp.lua index 8f37e24..03df3f1 100644 --- a/nvim/plugin/completar.lua +++ b/nvim/lua/plugins/cmp.lua @@ -2,6 +2,11 @@ local has_words_before = function() local line, col = unpack(vim.api.nvim_win_get_cursor(0)) return col ~= 0 and vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col):match("%s") == nil end + +if not packer_plugins["plenary.nvim"].loaded then + vim.cmd([[packadd plenary.nvim]]) +end + local luasnip = require("luasnip") local cmp = require("cmp") @@ -9,10 +14,12 @@ cmp.setup({ formatting = { format = function(entry, vim_item) vim_item.menu = ({ - nvim_lsp = ' [LSP]', - buffer = ' [Buffer]', - luasnip = ' [LuaSnip]', - nvim_lua = ' [Lua]', + nvim_lsp = '[LSP]', + buffer = '[Buffer]', + luasnip = '[Snippet]', + nvim_lua = '[API]', + path = '[Path]', + spell = '[Spell]', })[entry.source.name] vim_item.kind = ({ Text = ' text', @@ -54,19 +61,22 @@ cmp.setup({ [''] = cmp.mapping.select_next_item(), [''] = cmp.mapping.scroll_docs(-4), [''] = cmp.mapping.scroll_docs(4), - [''] = cmp.mapping.complete(), + [""] = cmp.mapping(function(_) + return vim.fn.pumvisible() == 1 and cmp.close() or cmp.complete() + end), [''] = cmp.mapping.close(), - [''] = cmp.mapping.confirm { - behavior = cmp.ConfirmBehavior.Replace, - select = true, - }, + [''] = cmp.mapping.confirm { select = true,}, [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_next_item() - elseif luasnip.expand_or_jumpable() then + elseif luasnip and luasnip.expand_or_jumpable() then luasnip.expand_or_jump() elseif has_words_before() then - cmp.complete() + vim.api.nvim_feedkeys( + vim.api.nvim_replace_termcodes("", true, true, true), + "n", + true + ) else fallback() end @@ -74,15 +84,26 @@ cmp.setup({ [""] = cmp.mapping(function(fallback) if cmp.visible() then cmp.select_prev_item() - elseif luasnip.jumpable(-1) then + elseif luasnip and luasnip.jumpable(-1) then luasnip.jump(-1) + elseif has_words_before() then + vim.api.nvim_feedkeys( + vim.api.nvim_replace_termcodes("", true, true, true), + "n", + true + ) else fallback() end end, { "i", "s" }), }, + preselect = cmp.PreselectMode.Item, sources = { - { name = 'buffer' }, + { name = 'path' }, + { name = 'buffer', Keyword_length = 5 }, }, - experimental = { custom_menu = true } + experimental = { native_menu = false } }) + +local cmp_autopairs = require("nvim-autopairs.completion.cmp") +cmp.event:on("confirm_done", cmp_autopairs.on_confirm_done()) diff --git a/nvim/lua/plugins/colorizer.lua b/nvim/lua/plugins/colorizer.lua new file mode 100644 index 0000000..6cc5329 --- /dev/null +++ b/nvim/lua/plugins/colorizer.lua @@ -0,0 +1,14 @@ +require 'colorizer'.setup ({ + 'css'; + 'html'; + 'javascript'; + 'javascriptreact'; + 'typescript'; + 'typescriptreact'; + 'vim'; + 'yaml'; + 'python'; +}, +{ + names = false; +}) diff --git a/nvim/plugin/gitgutter.lua b/nvim/lua/plugins/gitsigns_nvim.lua similarity index 84% rename from nvim/plugin/gitgutter.lua rename to nvim/lua/plugins/gitsigns_nvim.lua index d8d9095..5cf3124 100644 --- a/nvim/plugin/gitgutter.lua +++ b/nvim/lua/plugins/gitsigns_nvim.lua @@ -1,7 +1,10 @@ +if not packer_plugins["plenary.nvim"].loaded then + vim.cmd([[packadd plenary.nvim]]) +end + require('gitsigns').setup { signcolumn = true, - current_line_blame = true, - current_line_blame_opts = { virt_text_pos = 'right_align' }, + current_line_blame_opts = { delay = 2000, virt_text_pos = 'right_align' }, signs = { add = {hl = 'GitSignsAdd' , text = '┃', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, change = {hl = 'GitSignsChange', text = '┃', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, @@ -24,6 +27,7 @@ local map = vim.api.nvim_set_keymap local default_opts = {noremap = true, silent = true} map('n', 'tt', ':Gitsigns toggle_signs', default_opts) +map('n', 'tb', ':Gitsigns toggle_current_line_blame', default_opts) map('n', 'ff', ':G', default_opts) map('n', 'fc', ':GCheckout', default_opts) map('n', 'fd', ':Gvdiffsplit!', default_opts) diff --git a/nvim/plugin/lsps.lua b/nvim/lua/plugins/lspconfig.lua similarity index 72% rename from nvim/plugin/lsps.lua rename to nvim/lua/plugins/lspconfig.lua index 5db67d5..28386f1 100644 --- a/nvim/plugin/lsps.lua +++ b/nvim/lua/plugins/lspconfig.lua @@ -1,36 +1,28 @@ -local border = { - {"┌", "FloatBorder"}, - {"─", "FloatBorder"}, - {"┐", "FloatBorder"}, - {"│", "FloatBorder"}, - {"┘", "FloatBorder"}, - {"─", "FloatBorder"}, - {"└", "FloatBorder"}, - {"│", "FloatBorder"}, -} - vim.cmd [[ highlight LspDiagnosticsLineNrError guibg=#51202A guifg=#FF0000 gui=bold highlight LspDiagnosticsLineNrWarning guibg=#51412A guifg=#FFA500 gui=bold highlight LspDiagnosticsLineNrInformation guibg=#1E535D guifg=#00FFFF gui=bold highlight LspDiagnosticsLineNrHint guibg=#1E205D guifg=#008bbd gui=bold -sign define LspDiagnosticsSignError text= texthl=LspDiagnosticsSignError linehl= numhl=LspDiagnosticsLineNrError +sign define LspDiagnosticsSignError text= texthl=LspDiagnosticsSignError linehl= numhl=LspDiagnosticsLineNrError sign define LspDiagnosticsSignWarning text= texthl=LspDiagnosticsSignWarning linehl= numhl=LspDiagnosticsLineNrWarning -sign define LspDiagnosticsSignInformation text= texthl=LspDiagnosticsSignInformation linehl= numhl=LspDiagnosticsLineNrInformation +sign define LspDiagnosticsSignInformation text= texthl=LspDiagnosticsSignInformation linehl= numhl=LspDiagnosticsLineNrInformation sign define LspDiagnosticsSignHint text= texthl=LspDiagnosticsSignHint linehl= numhl=LspDiagnosticsLineNrHint ]] vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, { underline = true, signs = true, - virtual_text = false, - update_in_insert = true + update_in_insert = true, + severity_sort = true, + virtual_text = { + spacing = 5, + severity_limit = 'Hint', + source = 'always', + }, }) -vim.cmd ('autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics({border="single", focusable=false})') - -local nvim_lsp = require 'lspconfig' +local nvim_lsp = require'lspconfig' local on_attach = function(client, bufnr) vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') local opts = { noremap = true, silent = true } @@ -45,10 +37,9 @@ local on_attach = function(client, bufnr) vim.api.nvim_buf_set_keymap(bufnr, 'n', '}d', 'lua vim.lsp.diagnostic.goto_next()', opts) vim.api.nvim_buf_set_keymap(bufnr, 'n', 'qq', 'lua vim.lsp.diagnostic.set_loclist()', opts) vim.cmd [[ command! Format execute 'lua vim.lsp.buf.formatting()' ]] - vim.lsp.handlers["textDocument/hover"] = vim.lsp.with(vim.lsp.handlers.hover, { border = border, focusable = false }) vim.lsp.handlers["textDocument/signatureHelp"] = vim.lsp.with(vim.lsp.handlers.signature_help, { - border = "single", -}) + border = "single", + }) require "lsp_signature".on_attach({ bind = true, hint_prefix = " ", @@ -57,22 +48,9 @@ local on_attach = function(client, bufnr) trigger_on_newline = false, toggle_key = '', }) - if client.resolved_capabilities.document_highlight then - vim.api.nvim_exec( - [[ - hi LspReferenceRead gui=bold guibg=#1b1b29 blend=10 - hi LspReferenceText gui=bold guibg=#1b1b29 blend=10 - hi LspReferenceWrite gui=bold guibg=#1b1b29 blend=10 - augroup lsp_document_highlight - autocmd! * - autocmd CursorHold lua vim.lsp.buf.document_highlight() - autocmd CursorMoved lua vim.lsp.buf.clear_references() - augroup END - ]], false) - end end -require'lspconfig'.jsonls.setup { +nvim_lsp.jsonls.setup { commands = { Format = { function() @@ -83,15 +61,44 @@ require'lspconfig'.jsonls.setup { } require'lspconfig/configs'.ls_emmet = { - default_config = { - cmd = { 'ls_emmet', '--stdio' }; - filetypes = { 'html', 'css', 'scss', 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'haml', - 'xml', 'xsl', 'pug', 'slim', 'sass', 'stylus', 'less', 'sss', 'svelte'}; - root_dir = function(fname) - return vim.loop.cwd() - end; - settings = {}; - }; + default_config = { + cmd = { 'ls_emmet', '--stdio' }; + filetypes = { 'html', 'css', 'scss', 'javascript', 'javascriptreact', 'typescript', 'typescriptreact', 'haml', + 'xml', 'xsl', 'pug', 'slim', 'sass', 'stylus', 'less', 'sss', 'svelte'}; + root_dir = function(fname) + return vim.loop.cwd() + end; + settings = {}; + }; +} + +local shellcheck = { + lintCommand = 'shellcheck -f gcc -x', + lintSource = "shellcheck", + lintFormats = { + '%f:%l:%c: %trror: %m', + '%f:%l:%c: %tarning: %m', + '%f:%l:%c: %tote: %m' + }, +} +local shfmt = { + formatCommand = 'shfmt -ci -s -bn', + formatStdin = true, +} + +nvim_lsp.efm.setup{ + init_options = { + documentFormatting = true, + hover = true, + }, + settings = { + rootMarkers = { "package.json", "go.mod", ".git/", ".zshrc" }, + languages = { + bash = { shellcheck, shfmt }, + sh = { shellcheck, shfmt }, + }, + filetypes = {'bash', 'sh'} + } } local capabilities = vim.lsp.protocol.make_client_capabilities() @@ -108,7 +115,7 @@ capabilities.textDocument.completion.completionItem.resolveSupport = { } capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities) -local servers = { 'html', 'cssls', 'jsonls', 'tailwindcss', 'vimls', 'ls_emmet' } +local servers = { 'html', 'cssls', 'gopls', 'jsonls', 'tailwindcss', 'vimls', 'ls_emmet' } for _, lsp in ipairs(servers) do nvim_lsp[lsp].setup { on_attach = on_attach, @@ -119,11 +126,9 @@ end local sumneko_root_path ='/mnt/wd1tb/catacombs/code/lua-language-server' local sumneko_binary = sumneko_root_path .. '/bin/Linux/lua-language-server' - local runtime_path = vim.split(package.path, ';') table.insert(runtime_path, 'lua/?.lua') table.insert(runtime_path, 'lua/?/init.lua') - require('lspconfig').sumneko_lua.setup { cmd = { sumneko_binary, '-E', sumneko_root_path .. '/main.lua' }, on_attach = on_attach, diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua new file mode 100644 index 0000000..484ce54 --- /dev/null +++ b/nvim/lua/plugins/telescope.lua @@ -0,0 +1,143 @@ +vim.cmd([[packadd plenary.nvim]]) +vim.cmd([[packadd telescope-fzf-native.nvim]]) + +local actions = require('telescope.actions') +local previewers = require('telescope.previewers') +local Job = require('plenary.job') + +local new_maker = function(filepath, bufnr, opts) + filepath = vim.fn.expand(filepath) + Job + :new({ + command = 'file', + args = { '--mime-type', '-b', filepath }, + on_exit = function(j) + local mime_type = vim.split(j:result()[1], '/')[1] + if mime_type == 'text' then + previewers.buffer_previewer_maker(filepath, bufnr, opts) + else + vim.schedule(function() + vim.api.nvim_buf_set_lines(bufnr, 0, -1, false, { 'BINARY' }) + end) + end + end, + }) + :sync() +end + +require('telescope').setup { + defaults = { + prompt_title = " ", + results_title = " ", + preview_title = " ", + sorting_strategy = "ascending", + layout_config = { + width = 0.75, + prompt_position = "top", + preview_cutoff = 120, + }, + pickers = { + buffers = { + mappings = { + n = { + ['d'] = actions.delete_buffer, + }, + }, + sort_mru = true, + preview_title = false, + }, + find_files = { + find_command = {'fd', '-t f', '-c always', '-H'}, + hidden = true, + }, + file_browser = { + hidden = true, + }, + lsp_references = { + initial_mode = 'normal', + sorting_strategy = 'ascending', + layout_strategy = 'cursor', + preview_title = false, + results_title = false, + prompt_title = 'References', + layout_config = { + width = 0.4, + height = 0.4, + }, + }, + lsp_code_actions = { + initial_mode = 'normal', + sorting_strategy = 'ascending', + layout_strategy = 'cursor', + preview = false, + prompt_title = 'Code Actions', + results_title = '', + layout_config = { + width = 0.2, + height = 0.3, + }, + }, + lsp_range_code_actions = { + initial_mode = 'normal', + sorting_strategy = 'ascending', + layout_strategy = 'cursor', + preview = false, + prompt_title = 'Code Actions', + results_title = '', + layout_config = { + width = 0.3, + height = 0.3, + }, + }, + lsp_document_diagnostics = { + initial_mode = 'normal', + sorting_strategy = 'ascending', + layout_strategy = 'cursor', + prompt_title = 'Diagnostics', + results_title = '', + layout_config = { + width = 0.5, + height = 0.5, + }, + }, + lsp_definitions = { + layout_strategy = 'cursor', + prompt_title = 'Definitions', + preview_title = false, + results_title = false, + layout_config = { + width = 0.5, + height = 0.5, + }, + }, + }, + selection_caret = "→", + color_devicons = true, + file_ignore_patterns = { 'node_modules', '.git' }, + set_env = {['COLORTERM'] = 'truecolor'}, + buffer_previewer_maker = new_maker, + mappings = { + i = { + [""] = actions.smart_send_to_qflist + actions.open_qflist, + [""] = false, + [""] = actions.select_horizontal, + [""] = actions.select_default + actions.center, + [""] = actions.close, + }, + n = { + [""] = actions.smart_send_to_qflist + actions.open_qflist, + } + }, + } +} +require('telescope').load_extension('fzf') + +local map = vim.api.nvim_set_keymap +local default_opts = {noremap = true, silent = true} +map('n', '', 'Telescope help_tags', default_opts) +map('n', '', 'lua require("telescope.builtin").find_files({cwd = "%:h", hidden=true})', default_opts) +map('n', '', 'Telescope file_browser hidden=true', default_opts) +map('n', '', 'Telescope buffers', default_opts) +map('n', '', 'Telescope live_grep', default_opts) +map('n', '', 'Telescope git_commits', default_opts) +map('n', '', 'Telescope resume', default_opts) diff --git a/nvim/plugin/trees.lua b/nvim/lua/plugins/treesitter.lua similarity index 72% rename from nvim/plugin/trees.lua rename to nvim/lua/plugins/treesitter.lua index 8be69d8..2eeeacb 100644 --- a/nvim/plugin/trees.lua +++ b/nvim/lua/plugins/treesitter.lua @@ -1,16 +1,5 @@ -vim.lsp.handlers['textDocument/publishDiagnostics'] = vim.lsp.with( - vim.lsp.diagnostic.on_publish_diagnostics, - { - underline = true, - virtual_text = { - spacing = 5, - severity_limit = 'Hint', - }, - update_in_insert = true, - } -) require'nvim-treesitter.configs'.setup { - ensure_installed = { "bash", "css", "go", "gomod", "html", "json", "json5", "jsonc", "lua", "scss", "toml", "vim", "yaml" }, + ensure_installed = { "bash", "css", "go", "gomod", "html", "json", "json5", "jsonc", "lua", "regex", "scss", "toml", "vim", "yaml" }, highlight = { enable = true, use_languagetree = true, @@ -40,6 +29,12 @@ require'nvim-treesitter.configs'.setup { max_file_lines = nil, -- Do not enable for files with more than n lines, int }, autopairs = { enable = true }, - context_commentstring = { enable = true }, + context_commentstring = { + enable = true, + config = { + c = "// %s", + lua = "-- %s", + }, + }, } } diff --git a/nvim/lua/plugins/web-devicons.lua b/nvim/lua/plugins/web-devicons.lua new file mode 100644 index 0000000..3a269c5 --- /dev/null +++ b/nvim/lua/plugins/web-devicons.lua @@ -0,0 +1,92 @@ +local cmd = vim.cmd +local M = {} + +function M.init() + cmd([[packadd nvim-web-devicons]]) + require("nvim-web-devicons").setup({ + override = { + html = { + icon = "", + color = "#DE8C92", + name = "html", + }, + css = { + icon = "", + color = "#61afef", + name = "css", + }, + js = { + icon = "", + color = "#EBCB8B", + name = "js", + }, + ts = { + icon = "ﯤ", + color = "#519ABA", + name = "ts", + }, + rs = { + icon = "", + color = "#FFAA30", + name = "rs", + }, + kt = { + icon = "󱈙", + color = "#ffcb91", + name = "kt", + }, + png = { + icon = " ", + color = "#BD77DC", + name = "png", + }, + jpg = { + icon = " ", + color = "#BD77DC", + name = "jpg", + }, + jpeg = { + icon = " ", + color = "#BD77DC", + name = "jpeg", + }, + mp3 = { + icon = "", + color = "#C8CCD4", + name = "mp3", + }, + mp4 = { + icon = "", + color = "#C8CCD4", + name = "mp4", + }, + out = { + icon = "", + color = "#C8CCD4", + name = "out", + }, + toml = { + icon = "", + color = "#61afef", + name = "toml", + }, + lock = { + icon = "", + color = "#DE6B74", + name = "lock", + }, + zip = { + icon = "", + color = "#EBCB8B", + name = "zip", + }, + xz = { + icon = "", + color = "#EBCB8B", + name = "xz", + }, + }, + }) +end + +return M diff --git a/nvim/lua/plugins/windline_nvim.lua b/nvim/lua/plugins/windline_nvim.lua new file mode 100644 index 0000000..42470d4 --- /dev/null +++ b/nvim/lua/plugins/windline_nvim.lua @@ -0,0 +1,243 @@ +local windline = require('windline') +local helper = require('windline.helpers') +local sep = helper.separators +local vim_components = require('windline.components.vim') +local b_components = require('windline.components.basic') +local state = _G.WindLine.state +local lsp_comps = require('windline.components.lsp') +local git_comps = require('windline.components.git') + +local hl_list = { + Black = { 'white', 'black' }, + White = { 'black', 'white' }, + Inactive = { 'InactiveFg', 'InactiveBg' }, + Active = { 'ActiveFg', 'ActiveBg' }, +} +local basic = {} + +basic.divider = { b_components.divider, '' } +basic.space = { ' ', '' } +basic.bg = { ' ', 'StatusLine' } +basic.file_name_inactive = { b_components.full_file_name, hl_list.Inactive } +basic.line_col_inactive = { b_components.line_col, hl_list.Inactive } +basic.progress_inactive = { b_components.progress, hl_list.Inactive } + +basic.vi_mode = { + hl_colors = { + Normal = { 'black', 'blue', 'bold' }, + Insert = { 'black', 'red', 'bold' }, + Visual = { 'black', 'white', 'bold' }, + Replace = { 'black', 'blue_light', 'bold' }, + Command = { 'black', 'magenta', 'bold' }, + NormalBefore = { 'blue', 'black' }, + InsertBefore = { 'red', 'black' }, + VisualBefore = { 'white', 'black' }, + ReplaceBefore = { 'blue_light', 'black' }, + CommandBefore = { 'magenta', 'black' }, + NormalAfter = { 'white', 'blue' }, + InsertAfter = { 'white', 'red' }, + VisualAfter = { 'white', 'white' }, + ReplaceAfter = { 'white', 'blue_light' }, + CommandAfter = { 'white', 'magenta' }, + }, + text = function() + return { + { sep.left_rounded, state.mode[2] .. 'Before' }, + { state.mode[1] .. ' ', state.mode[2] }, + } + end, +} + +basic.lsp_diagnos = { + width = 90, + hl_colors = { + red = { 'red', 'black' }, + yellow = { 'yellow', 'black' }, + blue = { 'blue', 'black' }, + }, + text = function() + if lsp_comps.check_lsp() then + return { + { lsp_comps.lsp_error({ format = '  %s' }), 'red' }, + { lsp_comps.lsp_warning({ format = '  %s' }), 'yellow' }, + { lsp_comps.lsp_hint({ format = '  %s' }), 'blue' }, + } + end + return '' + end, +} + +local icon_comp = b_components.cache_file_icon({ default = '', hl_colors = {'white','black_light'} }) + +basic.file = { + hl_colors = { + default = { 'white', 'black_light' }, + }, + text = function(bufnr) + return { + { ' ', 'default' }, + icon_comp(bufnr), + { ' ', 'default' }, + { b_components.cache_file_name('[No Name]', ''), '' }, + { b_components.file_modified(' '), '' }, + -- { b_components.cache_file_size(), '' }, + } + end, +} +basic.right = { + hl_colors = { + sep_before = { 'black_light', 'white_light' }, + sep_after = { 'white_light', 'black' }, + text = { 'black', 'white_light' }, + }, + text = function() + return { + -- { b_components.line_col, 'text' }, + { b_components.progress, 'text' }, + { sep.right_rounded, 'sep_after' }, + } + end, +} +basic.git = { + width = 90, + hl_colors = { + green = { 'green', 'black' }, + red = { 'red', 'black' }, + blue = { 'blue', 'black' }, + }, + text = function() + if git_comps.is_git() then + return { + { ' ', '' }, + { git_comps.diff_added({ format = '+%s' }), 'green' }, + { git_comps.diff_removed({ format = '-%s' }), 'red' }, + { git_comps.diff_changed({ format = '~%s' }), 'blue' }, + } + end + return '' + end, +} +basic.logo = { + hl_colors = { + sep_before = { 'blue', 'black' }, + default = { 'black', 'blue' }, + }, + text = function() + return { + { sep.left_rounded, 'sep_before' }, + { ' ', 'default' }, + } + end, +} +-- LSP status +local lsp_status = require('lsp-status') +lsp_status.register_progress() +local lsp_config = require('lspconfig') + -- Lsp server name . +function lspservername() + local msg = '' + local buf_ft = vim.api.nvim_buf_get_option(0, 'filetype') + local clients = vim.lsp.get_active_clients() + if next(clients) == nil then return msg end + for _, client in ipairs(clients) do + local filetypes = client.config.filetypes + if filetypes and vim.fn.index(filetypes, buf_ft) ~= -1 then + return "LSP[" .. client.name .. "]" + end + end + return msg +end + +basic.lsp = { + width = 90, + hl_colors = { + red = { 'red', 'black' }, + yellow = { 'yellow', 'black' }, + blue = { 'blue', 'black' }, + }, + text = function() + return { + { lsp_status.status, 'red' }, + {" ", ""}, + { lspservername(), 'red' }, + } + end, +} + +basic.git_branch = { + + text = function() + return { + { git_comps.git_branch(), { 'green', 'black', '' }, 90 }, + } + end, +} + +local default = { + filetypes = { 'default' }, + active = { + basic.vi_mode, + { git_comps.git_branch(), { 'red', 'black', 'bold' }, 90 }, + basic.git, + basic.file, + { vim_components.search_count(), { 'red', 'black_light' } }, + { sep.right_rounded, { 'black_light', 'black' } }, + basic.divider, + basic.lsp_diagnos, + basic.lsp, + { ' ', hl_list.Black }, + basic.right, + -- { ' ', hl_list.Black }, + }, + in_active = { + basic.file_name_inactive, + basic.divider, + basic.divider, + basic.line_col_inactive, + { '', { 'white', 'InactiveBg' } }, + basic.progress_inactive, + }, +} + +local quickfix = { + filetypes = { 'qf', 'Trouble' }, + active = { + { '🚦 Quickfix ', { 'white', 'black' } }, + { helper.separators.slant_right, { 'black', 'black_light' } }, + { + function() + return vim.fn.getqflist({ title = 0 }).title + end, + { 'cyan', 'black_light' }, + }, + { ' Total : %L ', { 'cyan', 'black_light' } }, + { helper.separators.slant_right, { 'black_light', 'InactiveBg' } }, + { ' ', { 'InactiveFg', 'InactiveBg' } }, + basic.divider, + { helper.separators.slant_right, { 'InactiveBg', 'black' } }, + { '🧛 ', { 'white', 'black' } }, + }, + show_in_active = true, +} + +local explorer = { + filetypes = { 'fern', 'NvimTree', 'lir' }, + active = { + { '  ', { 'white', 'black' } }, + { helper.separators.slant_right, { 'black', 'black_light' } }, + { b_components.divider, '' }, + { b_components.file_name(''), { 'white', 'black_light' } }, + }, + show_in_active = true, +} +windline.setup({ + colors_name = function(colors) + -- ADD MORE COLOR HERE ---- + return colors + end, + statuslines = { + default, + quickfix, + explorer, + }, +}) diff --git a/nvim/plugin/autocmds.vim b/nvim/plugin/autocmds.vim index 9ceedd2..de138bf 100644 --- a/nvim/plugin/autocmds.vim +++ b/nvim/plugin/autocmds.vim @@ -6,6 +6,8 @@ if !exists('autocommands_loaded') && has('autocmd') aug OnInsert au InsertLeave * if &paste | setlocal nopaste | endif + au InsertLeave * set nocursorline + au InsertEnter * set cursorline au InsertLeave,CompleteDone * if pumvisible() == 0 | pclose | endif aug END diff --git a/nvim/plugin/color.vim b/nvim/plugin/color.vim new file mode 100644 index 0000000..d253f30 --- /dev/null +++ b/nvim/plugin/color.vim @@ -0,0 +1,4 @@ +colorscheme gruvbox +hi! Normal ctermbg=NONE guibg=NONE +hi! NonText ctermbg=NONE guibg=NONE guifg=NONE ctermfg=NONE +hi! SignColumn ctermbg=NONE guibg=NONE guifg=NONE ctermfg=NONE diff --git a/nvim/plugin/disabled.lua b/nvim/plugin/disabled.lua index b14f195..966301a 100644 --- a/nvim/plugin/disabled.lua +++ b/nvim/plugin/disabled.lua @@ -12,7 +12,6 @@ local disabled_builtin_plugins = { "logipat", "rrhelper", "matchit", - "matchparen", 'remote_plugins' } diff --git a/nvim/plugin/mappings/normal.vim b/nvim/plugin/mappings/normal.vim index 1134f55..a5d8b4f 100644 --- a/nvim/plugin/mappings/normal.vim +++ b/nvim/plugin/mappings/normal.vim @@ -5,8 +5,10 @@ nnoremap {q :cprev nnoremap }q :cnext nnoremap {Q :cfirst nnoremap }Q :clast -nnoremap {o :call append(line('.'), '') -nnoremap }o :call append(line('.')-1, '') +nnoremap {h :lprevious +nnoremap }l :lnext +nnoremap }o :call append(line('.'), '') +nnoremap {o :call append(line('.')-1, '') " Find nnoremap F :find =expand('%:h').'/*' @@ -56,8 +58,8 @@ nnoremap J mzJ`z nnoremap :noh=has('diff')?'diffupdate':'' " Shift lines up and down -nnoremap j :m .+1== -nnoremap k :m .-2== +nnoremap j :m .+1== +nnoremap k :m .-2== " j = gj :: k = gk while preserving numbered jumps ie. 12j or 30k nnoremap j v:count ? (v:count > 5 ? "m'" . v:count : '') . 'j' : 'gj' @@ -85,3 +87,6 @@ map q " Paths cnoremap =expand("%:p:h") . "/" + +" Run the last command +nnoremap C : diff --git a/nvim/plugin/mappings/terminal.vim b/nvim/plugin/mappings/terminal.vim index 3d9a240..3205ce3 100644 --- a/nvim/plugin/mappings/terminal.vim +++ b/nvim/plugin/mappings/terminal.vim @@ -3,3 +3,5 @@ tnoremap h tnoremap j tnoremap k tnoremap l +tnoremap +tnoremap diff --git a/nvim/plugin/mappings/visual.vim b/nvim/plugin/mappings/visual.vim index ec1b1fc..e2d2d21 100644 --- a/nvim/plugin/mappings/visual.vim +++ b/nvim/plugin/mappings/visual.vim @@ -2,6 +2,10 @@ vnoremap j v:count ? 'j' : 'gj' vnoremap k v:count ? 'k' : 'gk' +" Gotta Go Fast (save, buffers, quit, messages, indent, SOF, EOF) +nnoremap gg +nnoremap ¿ G + "Shift lines up and down vnoremap J :m '>+1gv=gv vnoremap K :m '<-2gv=gv diff --git a/nvim/plugin/settings.vim b/nvim/plugin/settings.vim index 3ad3b96..c79dec8 100644 --- a/nvim/plugin/settings.vim +++ b/nvim/plugin/settings.vim @@ -14,7 +14,7 @@ set cursorline set ignorecase set scrolloff=5 set sidescroll=5 -set shortmess+=aoIOWsc +set shortmess+=aoIOWc set nosmarttab set ttimeoutlen=10 set nowritebackup @@ -27,7 +27,7 @@ set diffopt+=algorithm:patience,indent-heuristic set diffopt+=foldcolumn:0 set diffopt+=vertical set fillchars=diff:\ ,eob:\ ,stlnc:\ ,stl:\ ,vert:\│ -set formatoptions=tnqj +set formatoptions=cnqj set completeopt=menu,menuone,noselect,noinsert let formatlistpat='^\s*\(\d\+[\]:.)}\t ]\|[*-][\t ]\)\s*' match ErrorMsg '^\(<\|=\|>\)\{7\}\([^=].\+\)\?$' @@ -44,6 +44,3 @@ let g:netrw_winsize = 25 let g:netrw_liststyle = 3 let g:netrw_localrmdir='rm -r' nnoremap :Vex! - -let g:LoupeClearHighlightMap = 1 -let g:LoupeCenterResults=0 diff --git a/nvim/plugin/telescopio.lua b/nvim/plugin/telescopio.lua deleted file mode 100644 index b4555a2..0000000 --- a/nvim/plugin/telescopio.lua +++ /dev/null @@ -1,59 +0,0 @@ -local actions = require('telescope.actions') -require('telescope').setup { - defaults = { - vimgrep_arguments = { - 'rg', - '--no-heading', - '--with-filename', - '--line-number', - '--column', - '--smart-case', - '--hidden' - }, - prompt_title = " ", - results_title = " ", - preview_title = " ", - sorting_strategy = "ascending", - layout_config = { - width = 0.75, - prompt_position = "top", - preview_cutoff = 120, - }, - pickers = { - find_files = { - find_command = {'fd', '-t f', '-c always', '-H'}, - hidden = true, - }, - file_browser = { - hidden = true, - }, - }, - selection_caret = "→", - color_devicons = true, - set_env = {['COLORTERM'] = 'truecolor'}, - mappings = { - i = { - [""] = actions.smart_send_to_qflist + actions.open_qflist, - [""] = false, - [""] = actions.select_horizontal, - [""] = actions.select_default + actions.center, - [""] = actions.close, - }, - n = { - [""] = actions.smart_send_to_qflist + actions.open_qflist, - } - }, - } -} - -require('telescope').load_extension('fzf') - -local map = vim.api.nvim_set_keymap -local default_opts = {noremap = true, silent = true} -map('n', '', 'Telescope help_tags', default_opts) -map('n', '', 'lua require("telescope.builtin").find_files({cwd = "%:h", hidden=true})', default_opts) -map('n', '', 'Telescope file_browser hidden=true', default_opts) -map('n', '', 'Telescope buffers', default_opts) -map('n', '', 'Telescope live_grep', default_opts) -map('n', '', 'Telescope git_commits', default_opts) -map('n', '', 'Telescope resume', default_opts) diff --git a/tmux/tmux.conf b/tmux/tmux.conf index 059f682..1237cf9 100644 --- a/tmux/tmux.conf +++ b/tmux/tmux.conf @@ -2,6 +2,8 @@ set -gs default-terminal "tmux-256color" # Optional set -gas terminal-overrides "*:Tc" set -gas terminal-overrides "*:RGB" +set -as terminal-overrides ',*:Smulx=\E[4::%p1%dm' +set -as terminal-overrides ',*:Setulc=\E[58::2::%p1%{65536}%/%d::%p1%{256}%/%{255}%&%d::%p1%{255}%&%d%;m' set -g set-titles-string "#S > #{=-15:?window_name,#{window_name},#{s/corpse/home/:?pane_current_path,#{b:pane_current_path},}} (#T)" set -g mode-keys vi set -g history-limit 102400 @@ -29,7 +31,7 @@ set -g monitor-activity on set -g bell-action none # Statusbar -set -g pane-border-format "#[align=centre] #{?pane_active,*,} #{pane_index} #[fg=terminal]#{pane_current_command} " +set -g pane-border-format "#[align=centre] #{?pane_active,*,} #{pane_index} #[fg=terminal]#{pane_current_command} " set -g set-titles on set -g pane-border-status bottom set -g automatic-rename-format '#{s/zsh//:pane_current_command}' @@ -54,6 +56,10 @@ unbind-key C-b unbind-key '"' unbind-key % unbind-key - +unbind-key Up +unbind-key Down +unbind-key Left +unbind-key Right # Prefijo set -g prefix F12 @@ -79,6 +85,10 @@ bind-key % delete-buffer # Paneles bind-key ( swap-pane -s :. -t :.- \; select-pane -t :.- bind-key ) swap-pane -s :. -t :.+ \; select-pane -t :.+ +bind-key Up select-pane -U +bind-key Down select-pane -D +bind-key Left select-pane -L +bind-key Right select-pane -R # Ventanas bind-key < previous-window diff --git a/zsh/conf/11_lf-icons.zsh b/zsh/conf/11_lf-icons.zsh index 28b0cae..fd9f5d6 100644 --- a/zsh/conf/11_lf-icons.zsh +++ b/zsh/conf/11_lf-icons.zsh @@ -5,14 +5,11 @@ ln= :\ or= :\ ex= :\ .git= :\ -Desktop= :\ -Documents= :\ -Downloads= :\ -Music= :\ -Pictures= :\ -Public= :\ -Templates= :\ -Videos= :\ +doc= :\ +etc= :\ +mus= :\ +img= :\ +vid= :\ mail= :\ .mail= :\ .cache= :\ @@ -20,7 +17,6 @@ mail= :\ trash= :\ Trash= :\ bin= :\ -hexagons= :\ xresources= :\ xinitrc= :\ .bashprofile= :\