diff --git a/.config/nvim/init.lua b/.config/nvim/init.lua index 15a794f..0665bd6 100644 --- a/.config/nvim/init.lua +++ b/.config/nvim/init.lua @@ -4,12 +4,13 @@ vim.g.maplocalleader = "\\" -- Initialize lazy.nvim require("config.lazy") --- vim.cmd([[ --- augroup jdtls_lsp --- autocmd! --- autocmd FileType java lua require'jdtls.jdtls_setup'.setup() --- augroup end --- ]]) + +vim.cmd([[ +augroup jdtls_lsp + autocmd! + autocmd FileType java lua require'jdtls.jdtls_setup'.setup() +augroup end +]]) -- Source other configuration files require("keybindings") diff --git a/.config/nvim/lua/keybindings.lua b/.config/nvim/lua/keybindings.lua index c95a8c3..c900a4c 100644 --- a/.config/nvim/lua/keybindings.lua +++ b/.config/nvim/lua/keybindings.lua @@ -15,3 +15,6 @@ map("n", "l", "l", opts) opts.desc = "Save session, write all buffers and quit" map("n", "qqq", ':lua require("auto-session").SaveSession():wqa', opts) + +opts.desc = "Visual copy" +map("v", "", '"*y', opts) diff --git a/.config/nvim/lua/plugins/file_navigation/neo-tree.lua b/.config/nvim/lua/plugins/file_navigation/neo-tree.lua index 57dd27d..85e6710 100644 --- a/.config/nvim/lua/plugins/file_navigation/neo-tree.lua +++ b/.config/nvim/lua/plugins/file_navigation/neo-tree.lua @@ -7,6 +7,9 @@ return { "nvim-tree/nvim-web-devicons", "MunifTanjim/nui.nvim", }, + opts = { + window = { position = "current" }, + }, config = function() require("neo-tree").setup({ filesystem = { @@ -19,23 +22,44 @@ return { }) local keymap = vim.keymap + keymap.set("n", "e", function() + require("neo-tree.command").execute({ + position = "left", + focus = "true", + }) + end, { desc = "Focus (Neotree)", noremap = true, silent = true }) + keymap.set("n", "ee", function() + require("neo-tree.command").execute({ + position = "left", + focus = "true", + }) + end, { desc = "Focus (Neotree)", noremap = true, silent = true }) + keymap.set("n", "qe", function() + require("neo-tree.command").execute({ + position = "left", + action = "close", + focus = "true", + }) + end, { desc = "Close (Neotree)", noremap = true, silent = true }) + + keymap.set("n", "|", "Neotree reveal", { desc = "", noremap = true, silent = true }) keymap.set( "n", - "ee", - "Neotree focus", - { desc = "Open and focus Neotree", noremap = true, silent = true } + "gd", + "Neotree float reveal_file= reveal_force_cwd", + { desc = "", noremap = true, silent = true } ) keymap.set( "n", - "e", - "Neotree toggle", - { desc = "Toggle Neotree", noremap = true, silent = true } + "eb", + "Neotree toggle show buffers right", + { desc = "Show buffers (Neotree)", noremap = true, silent = true } ) keymap.set( "n", - "eq", - "Neotree close", - { desc = "Close Neotree", noremap = true, silent = true } + "gs", + "Neotree float git_status", + { desc = "Show git status (Neotree)", noremap = true, silent = true } ) end, }, diff --git a/.config/nvim/lua/plugins/file_navigation/telescope.lua b/.config/nvim/lua/plugins/file_navigation/telescope.lua index 229806f..8eef14d 100644 --- a/.config/nvim/lua/plugins/file_navigation/telescope.lua +++ b/.config/nvim/lua/plugins/file_navigation/telescope.lua @@ -11,7 +11,7 @@ return { local telescope = require("telescope") local trouble_telescope = require("trouble.sources.telescope") local actions = require("telescope.actions") - local open_with_trouble = require("trouble.sources.telescope").open + local open_with_trouble = trouble_telescope.open -- Use this to add more results without clearing the trouble list local add_to_trouble = require("trouble.sources.telescope").add @@ -22,7 +22,9 @@ return { i = { [""] = actions.move_selection_previous, [""] = actions.move_selection_next, - [""] = trouble_telescope.open, + [""] = actions.preview_scrolling_up, + [""] = actions.preview_scrolling_down, + [""] = open_with_trouble, }, n = { [""] = open_with_trouble }, }, @@ -33,8 +35,14 @@ return { -- Set keymaps to load pickers local keymap = vim.keymap keymap.set("n", "ff", "Telescope find_files", { desc = "Fuzzy find files in cwd (Telescope)" }) - keymap.set("n", "fr", "Telescope oldfiles", { desc = "Fuzzy find recent files (Telescope)" }) + keymap.set( + "n", + "fr", + "Telescope oldfiles cwd_only=true", + { desc = "Fuzzy find recent files (Telescope)" } + ) keymap.set("n", "fs", "Telescope live_grep", { desc = "Find string in cwd (Telescope)" }) + keymap.set("v", "fs", "Telescope live_grep", { desc = "Find string in cwd (Telescope)" }) keymap.set( "n", "fc", diff --git a/.config/nvim/lua/plugins/language_support/conform.lua b/.config/nvim/lua/plugins/language_support/conform.lua index 99617bd..f21b2e8 100644 --- a/.config/nvim/lua/plugins/language_support/conform.lua +++ b/.config/nvim/lua/plugins/language_support/conform.lua @@ -33,6 +33,8 @@ return { conform.setup({ formatters_by_ft = { + groovy = { "npm-groovy-lint" }, + haskell = { "fourmolu" }, javascript = { decide_js_formatter() }, javascriptreact = { decide_js_formatter() }, json = { decide_json_formatter() }, @@ -41,16 +43,25 @@ return { nginx = { "nginxfmt" }, python = { "isort", "black" }, sh = { "shfmt" }, + sql = { "sql_formatter" }, typescript = { decide_js_formatter() }, typescriptreact = { decide_js_formatter() }, - yaml = { "yamlfix" }, + yaml = { "yamlfmt" }, + xml = { "xmlformatter" }, ["*"] = { "codespell" }, }, + formatters = { + sql_formatter = { + prepend_args = { "-c", '{"functionCase": "upper", "keywordCase": "upper"}', "-l", "postgresql" }, + }, + }, + default_format_opts = { lsp_format = "fallback", }, format_on_save = { + sh = true, lua = true, nginx = true, yaml = true, diff --git a/.config/nvim/lua/plugins/language_support/nvim-lint.lua b/.config/nvim/lua/plugins/language_support/nvim-lint.lua index b1467d6..8e2a5dd 100644 --- a/.config/nvim/lua/plugins/language_support/nvim-lint.lua +++ b/.config/nvim/lua/plugins/language_support/nvim-lint.lua @@ -13,7 +13,7 @@ return { local function decide_linter() local cwd = vim.fn.getcwd() if file_exists(cwd .. "/biome.json") then - return "biome" + return "biomejs" else return "eslint_d" end @@ -22,14 +22,13 @@ return { local lint = require("lint") lint.linters_by_ft = { - javascript = { "eslint_d" }, - javascriptreact = { "eslint_d" }, + javascript = { decide_linter() }, + javascriptreact = { decide_linter() }, markdown = { "markdownlint" }, python = { "flake8" }, sh = { "shellcheck" }, - typescript = { "eslint_d" }, - typescriptreact = { "eslint_d" }, - yaml = { "yamllint" }, + typescript = { decide_linter() }, + typescriptreact = { decide_linter() }, } local lint_augroup = vim.api.nvim_create_augroup("lint", { clear = true }) diff --git a/.config/nvim/lua/plugins/language_support/nvim-treesitter.lua b/.config/nvim/lua/plugins/language_support/nvim-treesitter.lua index e4ba229..347577d 100644 --- a/.config/nvim/lua/plugins/language_support/nvim-treesitter.lua +++ b/.config/nvim/lua/plugins/language_support/nvim-treesitter.lua @@ -5,19 +5,31 @@ return { config = function() require("nvim-treesitter.configs").setup({ ensure_installed = { + "bash", "css", "dockerfile", + "gitcommit", + "gitignore", + "groovy", "html", "javascript", "json", + "kotlin", "lua", "make", + "matlab", + "nginx", "pug", + "python", + "regex", "scss", + "sql", + "ssh_config", "typescript", "vim", "vimdoc", "vue", + "xml", "yaml", }, modules = {}, diff --git a/.config/nvim/lua/plugins/lsp/mason.lua b/.config/nvim/lua/plugins/lsp/mason.lua index d2eaaaa..3caa7c8 100644 --- a/.config/nvim/lua/plugins/lsp/mason.lua +++ b/.config/nvim/lua/plugins/lsp/mason.lua @@ -17,16 +17,25 @@ return { }) require("mason-lspconfig").setup({ + automatic_enable = { + exclude = { + "jdtls", + }, + }, ensure_installed = { "bashls", "cssls", "dockerls", "emmet_ls", "eslint", + "groovyls", "html", "jdtls", "jsonls", + "kotlin_lsp", + "lemminx", "lua_ls", + "postgres_lsp", "pylsp", "ts_ls", "vimls", @@ -45,18 +54,21 @@ return { "eslint_d", "firefox-debug-adapter", "flake8", + "fourmolu", "isort", "java-debug-adapter", "jq", "markdownlint", + "matlab-language-server", "mdformat", "nginx-config-formatter", + "npm-groovy-lint", "prettier", "shellcheck", "shfmt", "stylua", - "yamlfix", - "yamllint", + "xmlformatter", + "yamlfmt", }, }) end, diff --git a/.zinit.zsh b/.zinit.zsh index a1f49ca..a3dd561 100644 --- a/.zinit.zsh +++ b/.zinit.zsh @@ -29,15 +29,15 @@ zinit ice depth=1; zinit light romkatv/powerlevel10k ############### # FZF -zinit ice from="gh-r" as="command" bpick="*linux_amd64*" +zinit ice from"gh-r" as"command" bpick"*linux_amd64*" zinit light junegunn/fzf # FZF BYNARY AND TMUX HELPER SCRIPT -zinit ice lucid wait'0c' as="command" id-as="junegunn/fzf-tmux" pick="bin/fzf-tmux" +zinit ice lucid wait"0c" as"command" id-as"junegunn/fzf-tmux" pick"bin/fzf-tmux" zinit light junegunn/fzf # BIND MULTIPLE WIDGETS USING FZF -zinit ice lucid wait'0c' multisrc"shell/{completion,key-bindings}.zsh" id-as="junegunn/fzf_completions" pick="/dev/null" +zinit ice lucid wait"0c" multisrc"shell/{completion,key-bindings}.zsh" id-as"junegunn/fzf_completions" pick"/dev/null" zinit light junegunn/fzf # FZF-TAB @@ -46,22 +46,23 @@ zinit light Aloxaf/fzf-tab # AUTOSUGGESTIONS, TRIGGER PRECMD HOOK UPON LOAD ZSH_AUTOSUGGEST_BUFFER_MAX_SIZE=20 -zinit ice wait="0a" lucid atload="_zsh_autosuggest_start" +zinit ice wait"0a" lucid atload"_zsh_autosuggest_start" zinit light zsh-users/zsh-autosuggestions +# +# # ENHANCED +# zinit ice wait="0b" lucid +# zinit light b4b4r07/enhanced +# export ENHANCD_FILTER=fzf:fzy:peco -# ENHANCD -zinit ice wait="0b" lucid -zinit light b4b4r07/enhancd -export ENHANCD_FILTER=fzf:fzy:peco +#SYNTAX HIGHLIGHTING +zinit ice wait"0c" lucid atinit"zpcompinit;zpcdreplay" +zinit light zdharma-continuum/fast-syntax-highlighting # ZOXIDE -zinit ice wait="0" lucid from="gh-r" as="program" pick="zoxide-*/zoxide -> zoxide" cp="zoxide-*/completions/_zoxide -> _zoxide" atclone="./zoxide init zsh > init.zsh" atpull="%atclone" src="init.zsh" +zinit ice wait"0" lucid from"gh-r" as"program" pick"zoxide-*/zoxide -> zoxide" cp"zoxide-*/completions/_zoxide -> _zoxide" atclone"./zoxide init zsh > init.zsh" atpull"%atclone" src"init.zsh" zinit light ajeetdsouza/zoxide # TAB COMPLETIONS -zinit ice wait="0b" lucid blockf -zinit light zsh-users/zsh-completions +# zinit ice wait="0b" lucid blockf +# zinit light zsh-users/zsh-completions -# SYNTAX HIGHLIGHTING -zinit ice wait="0c" lucid atinit="zpcompinit;zpcdreplay" -zinit light zdharma-continuum/fast-syntax-highlighting diff --git a/.zshrc b/.zshrc index aa8460f..0e92f15 100644 --- a/.zshrc +++ b/.zshrc @@ -54,3 +54,6 @@ alias python="python3" [[ ! -f ~/.localrc.zsh ]] || source ~/.localrc.zsh +eval $(thefuck --alias) + +[ -f /opt/miniconda3/etc/profile.d/conda.sh ] && source /opt/miniconda3/etc/profile.d/conda.sh diff --git a/.zstyle.zsh b/.zstyle.zsh index d5eab4d..c42d8ca 100644 --- a/.zstyle.zsh +++ b/.zstyle.zsh @@ -15,7 +15,7 @@ zstyle ':completion:*' completer _expand _complete _ignored _approximate zstyle ':completion:*' matcher-list 'm:{a-z}={A-Z}' # Disable the menu selection feature (automatically select the first match) -zstyle ':completion:*' menu no +zstyle ':completion:*' menu select # Customize the prompt shown when scrolling through completions # - `%SScrolling active: current selection at %p%s`: Shows a message indicating that scrolling is active and the current selection. @@ -23,7 +23,7 @@ zstyle ':completion:*' select-prompt '%SScrolling active: current selection at % # Format descriptions in completion lists # - `[%d]`: Wrap descriptions in square brackets. -zstyle ':completion:*:descriptions' format '[%d]' + zstyle ':completion:*:descriptions' format '[%d]' # Specify the command to use for completing process names # - `ps -au$USER`: List processes for the current user. @@ -42,22 +42,30 @@ zstyle ":completion:*:git-checkout:*" sort false # Apply LS_COLORS to completion lists for colored output zstyle ':completion:*' list-colors ${(s.:.)LS_COLORS} +zstyle ':completion:*' menu select +zstyle ':completion:*:matches' group 'yes' +zstyle ':completion:*:options' description 'yes' +zstyle ':completion:*:options' auto-description '%d' +zstyle ':completion:*:corrections' format '%U%F{red}-- %d (errors: %e) --%f%u' +zstyle ':completion:*:descriptions' format '%U%F{yellow}-- %d --%f%u' +zstyle ':completion:*:messages' format '%F{purple} -- %d --%f' +zstyle ':completion:*:warnings' format '%F{red} -- no matches found --%f' # Configure fzf-tab behavior - -# Use the input string as the query string for _zlua completions -zstyle ':fzf-tab:complete:_zlua:*' query-string input - -# Customize the kill command completion with fzf-tab -# - `extra-opts`: Additional options for fzf, including a preview window showing the command of the selected process. -zstyle ':fzf-tab:complete:kill:argument-rest' extra-opts --preview=$extract'ps --pid=$in[(w)1] -o cmd --no-headers -w -w' --preview-window=down:3:wrap - -# Customize the cd command completion with fzf-tab -# - `fzf-preview`: Show a preview of directories using `eza` (a modern replacement for `ls`). -zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath' - -# Customize the z command completion with fzf-tab -# - `fzf-preview`: Show a preview of directories using `eza`. -zstyle ':fzf-tab:complete:z:*' fzf-preview 'eza -1 --color=always $realpath' - -# Use default fzf options for fzf-tab -zstyle ':fzf-tab:*' use-fzf-default-opts yes +# +# # Use the input string as the query string for _zlua completions +# zstyle ':fzf-tab:complete:_zlua:*' query-string input +# +# # Customize the kill command completion with fzf-tab +# # - `extra-opts`: Additional options for fzf, including a preview window showing the command of the selected process. +# zstyle ':fzf-tab:complete:kill:argument-rest' extra-opts --preview=$extract'ps --pid=$in[(w)1] -o cmd --no-headers -w -w' --preview-window=down:3:wrap +# +# # Customize the cd command completion with fzf-tab +# # - `fzf-preview`: Show a preview of directories using `eza` (a modern replacement for `ls`). +# zstyle ':fzf-tab:complete:cd:*' fzf-preview 'eza -1 --color=always $realpath' +# +# # Customize the z command completion with fzf-tab +# # - `fzf-preview`: Show a preview of directories using `eza`. +# zstyle ':fzf-tab:complete:z:*' fzf-preview 'eza -1 --color=always $realpath' +# +# # Use default fzf options for fzf-tab +# zstyle ':fzf-tab:*' use-fzf-default-opts yes