From cff5fbfcb8e7c8335a7eb2467e740bad682f57d5 Mon Sep 17 00:00:00 2001 From: MaMrEzO Date: Tue, 17 Sep 2024 12:07:08 +0330 Subject: [PATCH] latest chnages --- .cspell | 0 .exports | 56 +++ after.zip | Bin 0 -> 1853 bytes after/queries/go/highlights.scm | 19 + after/queries/go/injections.scm | 20 + after/queries/lua/highlights.scm | 45 ++ clipboard.lua | 16 + cspell.json | 2 +- init.lua | 17 +- lazy-lock.json | 101 ++-- lua/user/configs/cspell.lua | 9 + lua/user/configs/neo-tree.lua | 595 ++++++++++++---------- lua/user/configs/noice-config.lua | 30 +- lua/user/configs/notify-config.lua | 10 +- lua/user/lazy.lua | 637 +++++++++++++---------- lua/user/lsp.lua | 186 ++++--- lua/user/mapping/telescope-mapping.lua | 142 +++--- lua/user/nvim-cmp.lua | 23 +- lua/user/options.lua | 273 +++++----- lua/user/plugins_with_packer.lua | 638 ++++++++++++------------ lua/user/setups.lua | 69 +-- lua/user/setups/dap.lua | 212 ++++++-- lua/user/setups/diffview.lua | 2 +- lua/user/setups/dropbar-setup.lua | 4 +- lua/user/setups/gitsigns.lua | 98 ++-- lua/user/setups/inlay-hint-setup.lua | 4 + lua/user/setups/lint.lua | 75 +++ lua/user/setups/lua-line.lua | 10 +- lua/user/setups/mason-null-ls-setup.lua | 102 ++-- lua/user/setups/mason.lua | 38 +- lua/user/setups/nvim-ufo.lua | 38 ++ lua/user/setups/statuscol-setup.lua | 15 + lua/user/setups/telescope.lua | 71 ++- lua/user/setups/tree-sitter.lua | 63 +-- queries/go/injections.scm | 22 + queries/go/locals.scm | 1 + queries/typescript/injections.scm | 4 + spell/en.utf-8.add | 12 + spell/en.utf-8.add.spl | Bin 0 -> 198 bytes 39 files changed, 2235 insertions(+), 1424 deletions(-) create mode 100644 .cspell create mode 100644 .exports create mode 100644 after.zip create mode 100644 after/queries/go/highlights.scm create mode 100644 after/queries/go/injections.scm create mode 100644 after/queries/lua/highlights.scm create mode 100644 clipboard.lua mode change 100644 => 120000 cspell.json create mode 100644 lua/user/configs/cspell.lua create mode 100644 lua/user/setups/inlay-hint-setup.lua create mode 100644 lua/user/setups/lint.lua create mode 100644 lua/user/setups/nvim-ufo.lua create mode 100644 lua/user/setups/statuscol-setup.lua create mode 100644 queries/go/injections.scm create mode 100644 queries/go/locals.scm create mode 100644 queries/typescript/injections.scm create mode 100644 spell/en.utf-8.add create mode 100644 spell/en.utf-8.add.spl diff --git a/.cspell b/.cspell new file mode 100644 index 0000000..e69de29 diff --git a/.exports b/.exports new file mode 100644 index 0000000..1bb184a --- /dev/null +++ b/.exports @@ -0,0 +1,56 @@ +COLORTERM=truecolor +DBUS_SESSION_BUS_ADDRESS='unix:path=/run/user/1000/bus' +DEBUGINFOD_URLS='https://debuginfod.archlinux.org ' +DESKTOP_SESSION=plasma +DISPLAY=:1 +GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:/home/nima/.gtkrc-2.0:/home/nima/.config/gtkrc-2.0 +GTK_RC_FILES=/etc/gtk/gtkrc:/home/nima/.gtkrc:/home/nima/.config/gtkrc +HOME=/home/nima +INVOCATION_ID=0ae540d23aa043c79cbfdd97fc6d11c4 +JOURNAL_STREAM=8:8850 +KDE_APPLICATIONS_AS_SCOPE=1 +KDE_FULL_SESSION=true +KDE_SESSION_UID=1000 +KDE_SESSION_VERSION=6 +KITTY_INSTALLATION_DIR=/usr/lib/kitty +KITTY_PID=4425 +KITTY_PUBLIC_KEY='1:Q6UnaxD^DoV-Q<| z2Ll&tNyLQOKfF&E85le{7#I|=s?W$w&&UDdl48B$rl#6RZ~0LjNj{D z+}3tBeiwSx!fuzT?m?4PNA9nW_gT1qVZWZKZk5C8s2_GRnN~?xryJYto3C;&;{>y! zx6pz`b2-nr+A&qVe(qSyrTZdIsY^KEbK0!i(~?E}%brj0SJG6BWwLQt+xt~i%|R-0 z`Olq`l6PHJms#>XeUkYumGJUYoT02Y?<_xDzsvC9%)5KP*&AQX>aIMwCH{dQPpPCz z(jwmsmfyKI{4G;v?wWk^`ul@lbQFZ&6~9%D__F5VvG9Jigm&h8VZurdylp*i>Th$M zI`;PGosKfkp!uQ4b7y+DpE2w6>HB#oIQ@{zeu?OL&71c;t)Kd6iio%W{5wlx|AysW z$~1pEt@5JS(?zq5xT^)eCjUMx9lOIbQj6>N&UedLc15q4Q+Q_6lG&^CPVs5)`&?=M zG_JEK_+4ra!lT64Y5DBvDH?$jrUkwVh*krI>(Pf3J(O*rFypt38#L?w?+ zIcj>U?f1<)tRT?(-ICSUEG_Zzy1g%b*9giz?o_*AWKrKeZ|{vhVb@$O36*EI`^-(w zZeM8;k)X`%V)DaF>ue2_IXz3y*MJX4(OA8Dt${<2?Lsm=Z`uCpJ_l6Aq+~d=<<9y!M0_B2#ldjB`hXf@kvoR-@MC298+pGYFi31aku*uBJ zN=+`w%+CYowX+ip`3@QIxPG5^Xv$K_t`~D!XNLs7YFltcvs3%QHx?!>j)(~pBpw~C zyZC$Clu$)ghL8#w=3^PQThFf~EJj+TlE#%%UU4=&G*`n9kBM0X`q zcE+XE(i0^DmwcLf;u4>!df8H2!=PjGHTnl8|7eQaDY<#c-7AS}w_ht|e98PwWTvNN z%cUPi?FqM*dB7gSWjz+1-vAQM$Dq~L_;$5nK~ z^e<^_z^WfL;p6i?D4W5+TgOGf)Pm|7aHc~z23xj+X b.path - -- else - -- return a.type > b.type - -- end - -- end , -- this sorts files and directories descendantly - view = { - relativenumber = true, - }, - default_component_configs = { - container = { - enable_character_fade = true - }, - indent = { - indent_size = 2, - padding = 1, -- extra padding on left hand side - -- indent guides - with_markers = true, - indent_marker = "│", - last_indent_marker = "╰ ", - highlight = "NeoTreeIndentMarker", - -- expander config, needed for nesting files - with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders - expander_collapsed = "", - expander_expanded = "", - expander_highlight = "NeoTreeExpander", - }, - icon = { - folder_closed = "", - folder_open = "", - folder_empty = "", - -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there - -- then these will never be used. - default = "*", - highlight = "NeoTreeFileIcon" - }, - modified = { - symbol = "[+]", - highlight = "NeoTreeModified", - }, - name = { - trailing_slash = false, - use_git_status_colors = true, - highlight = "NeoTreeFileName", - }, - git_status = { - symbols = { - -- Change type - added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name - modified = "", -- or "", but this is redundant info if you use git_status_colors on the name - deleted = "✖", -- this can only be used in the git_status source - renamed = "", -- this can only be used in the git_status source - -- Status type - untracked = "", - ignored = "", - unstaged = "", - staged = "", - conflict = "", - } - }, - }, - -- A list of functions, each representing a global custom command - -- that will be available in all sources (if not overridden in `opts[source_name].commands`) - -- see `:h neo-tree-global-custom-commands` - commands = {}, - window = { - position = "left", - width = 40, - mapping_options = { - noremap = true, - nowait = true, - }, - mappings = { - [""] = { - "toggle_node", - nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use - }, - ["<2-LeftMouse>"] = "open", - ["o"] = "open", - [""] = "revert_preview", - ["P"] = { "toggle_preview", config = { use_float = true } }, - ["l"] = "focus_preview", - ["S"] = "open_split", - ["s"] = "open_vsplit", - -- ["S"] = "split_with_window_picker", - -- ["s"] = "vsplit_with_window_picker", - ["t"] = "open_tabnew", - -- [""] = "open_drop", - -- ["t"] = "open_tab_drop", - ["w"] = "open_with_window_picker", - --["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing - ["C"] = "close_node", - -- ['C'] = 'close_all_subnodes', - ["z"] = "close_all_nodes", - --["Z"] = "expand_all_nodes", - ["a"] = { - "add", - -- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details - -- some commands may take optional config options, see `:h neo-tree-mappings` for details - config = { - show_path = "none" -- "none", "relative", "absolute" - } - }, - ["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion. - ["d"] = "delete", - ["r"] = "rename", - ["y"] = "copy_to_clipboard", - ["x"] = "cut_to_clipboard", - ["p"] = "paste_from_clipboard", - ["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add": - -- ["c"] = { - -- "copy", - -- config = { - -- show_path = "none" -- "none", "relative", "absolute" - -- } - --} - ["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add". - ["q"] = "close_window", - ["R"] = "refresh", - ["?"] = "show_help", - ["<"] = "prev_source", - [">"] = "next_source", - [""] = function(state) - require("neo-tree.command").execute({ action = "open" }) - require("neo-tree.command").execute({ action = "close" }) - end - } - }, - nesting_rules = {}, - filesystem = { - filtered_items = { - visible = false, -- when true, they will just be displayed differently than normal items - hide_dotfiles = true, - hide_gitignored = true, - hide_hidden = true, -- only works on Windows for hidden files/directories - hide_by_name = { - --"node_modules" - }, - hide_by_pattern = { -- uses glob style patterns - --"*.meta", - --"*/src/*/tsconfig.json", - }, - always_show = { -- remains visible even if other settings would normally hide it - --".gitignored", - }, - never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show - --".DS_Store", - --"thumbs.db" - }, - never_show_by_pattern = { -- uses glob style patterns - --".null-ls_*", - }, - }, - follow_current_file = false, -- This will find and focus the file in the active buffer every - -- time the current file is changed while the tree is open. - group_empty_dirs = false, -- when true, empty folders will be grouped together - hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree - -- in whatever position is specified in window.position - -- "open_current", -- netrw disabled, opening a directory opens within the - -- window like netrw would, regardless of window.position - -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs - use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes - -- instead of relying on nvim autocmd events. - window = { - mappings = { - [""] = "navigate_up", - ["."] = "set_root", - ["H"] = "toggle_hidden", - ["/"] = "fuzzy_finder", - ["D"] = "fuzzy_finder_directory", - ["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm - -- ["D"] = "fuzzy_sorter_directory", - ["f"] = "filter_on_submit", - [""] = "clear_filter", - ["[g"] = "prev_git_modified", - ["]g"] = "next_git_modified", - }, - fuzzy_finder_mappings = { - -- define keymaps for filter popup window in fuzzy_finder_mode - [""] = "move_cursor_down", - [""] = "move_cursor_down", - [""] = "move_cursor_up", - [""] = "move_cursor_up", - }, - }, - commands = {} -- Add a custom command or override a global one using the same function name - }, - buffers = { - follow_current_file = true, -- This will find and focus the file in the active buffer every - -- time the current file is changed while the tree is open. - group_empty_dirs = true, -- when true, empty folders will be grouped together - show_unloaded = true, - window = { - mappings = { - ["bd"] = "buffer_delete", - [""] = "navigate_up", - ["."] = "set_root", - } - }, - }, - git_status = { - window = { - position = "float", - mappings = { - ["A"] = "git_add_all", - ["gu"] = "git_unstage_file", - ["ga"] = "git_add_file", - ["gr"] = "git_revert_file", - ["gc"] = "git_commit", - ["gp"] = "git_push", - ["gg"] = "git_commit_and_push", - } - } - }, - sources = { - "filesystem", - "buffers", - "git_status", - "document_symbols", - }, - source_selector = { - --sources = { - -- "filesystem", - -- "buffers", - -- "git_status", - -- "document_symbols", - --}, - sources = { - { source = "filesystem", display_name = " 󰉓 Files " }, - { source = "git_status", display_name = " 󰊢 Git " }, - { source = "buffers", display_name = " 󰈔 Buffs " }, - { source = "document_symbols", display_name = "  Outline " }, - }, - winbar = true, - --statusline = false - }, - event_handlers = { - --{ - -- event = "file_opened", - -- handler = function(file_path) - -- -- auto close - -- -- vimc.cmd("Neotree close") - -- -- OR - -- print("About to close neo-tree") - -- require("neo-tree.command").execute({ action = "close" }) - -- end - --}, + vim.api.nvim_create_autocmd("FileType", { + pattern = "dap-repl", + callback = function(ev) + print(string.format('event fired: %s', vim.inspect(ev))) + print(string.format('event fired: %s', vim.inspect(ev.buf))) + terminal.attach_to_buffer(ev.buff) + end + }) - } - }) + --vim.api.nvim_create_autocmd({ "BufWinEnter", "BufWinEnter" }, { + -- pattern = "neo-tree", + -- --command = "setl ft=terminal" + -- callback = function(ev) + -- print('Huh got it') + -- --vim.api.nvim_set_option_value('modeline', false, { buf = ev }) + -- vim.api.nvim_buf_set_option('relativenumber', true, { buf = ev.buf }) + -- end + --}) + --vim.cmd([[ autocmd BufWinEnter NvimTree setlocal relativenumber ]]) + --vim.cmd([[ autocmd BufWinEnter NvimTree set relativenumber ]]) + --vim.cmd([[ autocmd FileType NvimTree setlocal relativenumber ]]) + --vim.cmd([[ autocmd FileType NvimTree set relativenumber ]]) + -- If you want icons for diagnostic errors, you'll need to define them somewhere: + vim.fn.sign_define("DiagnosticSignError", + { text = " ", texthl = "DiagnosticSignError" }) + vim.fn.sign_define("DiagnosticSignWarn", + { text = " ", texthl = "DiagnosticSignWarn" }) + vim.fn.sign_define("DiagnosticSignInfo", + { text = " ", texthl = "DiagnosticSignInfo" }) + vim.fn.sign_define("DiagnosticSignHint", + { text = "", texthl = "DiagnosticSignHint" }) + -- NOTE: this is changed from v1.x, which used the old style of highlight groups + -- in the form "LspDiagnosticsSignWarning" + require("neo-tree").setup({ + close_if_last_window = false, -- Close Neo-tree if it is the last window left in the tab + popup_border_style = "rounded", + enable_git_status = true, + enable_diagnostics = true, + open_files_do_not_replace_types = { "terminal", "trouble", "qf" }, -- when opening files, do not use windows containing these filetypes or buftypes + sort_case_insensitive = false, -- used when sorting files and directories in the tree + sort_function = nil, -- use a custom function for sorting files and directories in the tree + -- sort_function = function (a,b) + -- if a.type == b.type then + -- return a.path > b.path + -- else + -- return a.type > b.type + -- end + -- end , -- this sorts files and directories descendantly + view = { + relativenumber = true, + }, + default_component_configs = { + container = { + enable_character_fade = true + }, + indent = { + indent_size = 2, + padding = 1, -- extra padding on left hand side + -- indent guides + with_markers = true, + indent_marker = "│", + last_indent_marker = "╰ ", + highlight = "NeoTreeIndentMarker", + -- expander config, needed for nesting files + with_expanders = nil, -- if nil and file nesting is enabled, will enable expanders + expander_collapsed = "", + expander_expanded = "", + expander_highlight = "NeoTreeExpander", + }, + icon = { + folder_closed = "", + folder_open = "", + folder_empty = "", + -- The next two settings are only a fallback, if you use nvim-web-devicons and configure default icons there + -- then these will never be used. + default = "*", + highlight = "NeoTreeFileIcon" + }, + modified = { + symbol = "[+]", + highlight = "NeoTreeModified", + }, + name = { + trailing_slash = false, + use_git_status_colors = true, + highlight = "NeoTreeFileName", + }, + git_status = { + symbols = { + -- Change type + added = "", -- or "✚", but this is redundant info if you use git_status_colors on the name + modified = "", -- or "", but this is redundant info if you use git_status_colors on the name + deleted = "✖", -- this can only be used in the git_status source + renamed = "", -- this can only be used in the git_status source + -- Status type + untracked = "", + ignored = "", + unstaged = "", + staged = "", + conflict = "", + } + }, + file_size = { + enabled = false, + required_width = 64, -- min width of window required to show this column + }, + type = { + enabled = false, + required_width = 122, -- min width of window required to show this column + }, + last_modified = { + enabled = false, + required_width = 88, -- min width of window required to show this column + }, + created = { + enabled = false, + required_width = 110, -- min width of window required to show this column + }, + }, + -- A list of functions, each representing a global custom command + -- that will be available in all sources (if not overridden in `opts[source_name].commands`) + -- see `:h neo-tree-global-custom-commands` + commands = {}, + window = { + position = "left", + width = 40, + mapping_options = { + noremap = true, + nowait = true, + }, + mappings = { + [""] = { + "toggle_node", + nowait = false, -- disable `nowait` if you have existing combos starting with this char that you want to use + }, + ["<2-LeftMouse>"] = "open", + ["o"] = "open", + [""] = "revert_preview", + ["P"] = { "toggle_preview", config = { use_float = true } }, + ["l"] = "focus_preview", + ["S"] = "open_split", + ["s"] = "open_vsplit", + -- ["S"] = "split_with_window_picker", + -- ["s"] = "vsplit_with_window_picker", + ["t"] = "open_tabnew", + -- [""] = "open_drop", + -- ["t"] = "open_tab_drop", + ["w"] = "open_with_window_picker", + --["P"] = "toggle_preview", -- enter preview mode, which shows the current node without focusing + ["C"] = "close_node", + -- ['C'] = 'close_all_subnodes', + ["z"] = "close_all_nodes", + --["Z"] = "expand_all_nodes", + ["a"] = { + "add", + -- this command supports BASH style brace expansion ("x{a,b,c}" -> xa,xb,xc). see `:h neo-tree-file-actions` for details + -- some commands may take optional config options, see `:h neo-tree-mappings` for details + config = { + show_path = "none" -- "none", "relative", "absolute" + } + }, + ["A"] = "add_directory", -- also accepts the optional config.show_path option like "add". this also supports BASH style brace expansion. + ["d"] = "delete", + ["r"] = "rename", + ["y"] = "copy_to_clipboard", + ["x"] = "cut_to_clipboard", + ["p"] = "paste_from_clipboard", + ["c"] = "copy", -- takes text input for destination, also accepts the optional config.show_path option like "add": + -- ["c"] = { + -- "copy", + -- config = { + -- show_path = "none" -- "none", "relative", "absolute" + -- } + --} + ["m"] = "move", -- takes text input for destination, also accepts the optional config.show_path option like "add". + ["q"] = "close_window", + ["R"] = "refresh", + ["?"] = "show_help", + ["<"] = "prev_source", + [">"] = "next_source", + [""] = function(state) + require("neo-tree.command").execute({ action = "open" }) + require("neo-tree.command").execute({ action = "close" }) + end + } + }, + nesting_rules = {}, + filesystem = { + filtered_items = { + visible = false, -- when true, they will just be displayed differently than normal items + hide_dotfiles = false, + hide_gitignored = false, + hide_hidden = true, -- only works on Windows for hidden files/directories + hide_by_name = { + --"node_modules" + }, + hide_by_pattern = { -- uses glob style patterns + --"*.meta", + --"*/src/*/tsconfig.json", + }, + always_show = { -- remains visible even if other settings would normally hide it + ".gitignored", + }, + never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show + --".DS_Store", + --"thumbs.db" + }, + never_show_by_pattern = { -- uses glob style patterns + --".null-ls_*", + }, + }, + follow_current_file = false, -- This will find and focus the file in the active buffer every + -- time the current file is changed while the tree is open. + group_empty_dirs = false, -- when true, empty folders will be grouped together + hijack_netrw_behavior = "open_default", -- netrw disabled, opening a directory opens neo-tree + -- in whatever position is specified in window.position + -- "open_current", -- netrw disabled, opening a directory opens within the + -- window like netrw would, regardless of window.position + -- "disabled", -- netrw left alone, neo-tree does not handle opening dirs + use_libuv_file_watcher = false, -- This will use the OS level file watchers to detect changes + -- instead of relying on nvim autocmd events. + window = { + mappings = { + [""] = "navigate_up", + ["."] = "set_root", + ["H"] = "toggle_hidden", + ["/"] = "fuzzy_finder", + ["D"] = "fuzzy_finder_directory", + ["#"] = "fuzzy_sorter", -- fuzzy sorting using the fzy algorithm + -- ["D"] = "fuzzy_sorter_directory", + ["f"] = "filter_on_submit", + [""] = "clear_filter", + ["[g"] = "prev_git_modified", + ["]g"] = "next_git_modified", + }, + fuzzy_finder_mappings = { + -- define keymaps for filter popup window in fuzzy_finder_mode + [""] = "move_cursor_down", + [""] = "move_cursor_down", + [""] = "move_cursor_up", + [""] = "move_cursor_up", + }, + }, + commands = {} -- Add a custom command or override a global one using the same function name + }, + buffers = { + follow_current_file = true, -- This will find and focus the file in the active buffer every + -- time the current file is changed while the tree is open. + group_empty_dirs = true, -- when true, empty folders will be grouped together + show_unloaded = true, + window = { + mappings = { + ["bd"] = "buffer_delete", + [""] = "navigate_up", + ["."] = "set_root", + } + }, + }, + git_status = { + window = { + position = "float", + mappings = { + ["A"] = "git_add_all", + ["gu"] = "git_unstage_file", + ["ga"] = "git_add_file", + ["gr"] = "git_revert_file", + ["gc"] = "git_commit", + ["gp"] = "git_push", + ["gg"] = "git_commit_and_push", + } + } + }, + sources = { + "filesystem", + "buffers", + "git_status", + --"document_symbols", + }, + source_selector = { + --sources = { + -- "filesystem", + -- "buffers", + -- "git_status", + -- "document_symbols", + --}, + sources = { + { source = "filesystem", display_name = " 󰉓 Files " }, + { source = "buffers", display_name = " 󰈔 Buffs " }, + { source = "git_status", display_name = " 󰊢 Git " }, + { source = "document_symbols", display_name = "  Outline " }, + }, + winbar = true, + --statusline = false + }, + event_handlers = { + { + event = "neo_tree_buffer_enter", + handler = function() + vim.opt_local.relativenumber = true + vim.opt_local.foldcolumn = '0' + --print('Hum') + end, + }, + }, + --event_handlers = { + -- --{ + -- -- event = "file_opened", + -- -- handler = function(file_path) + -- -- -- auto close + -- -- -- vimc.cmd("Neotree close") + -- -- -- OR + -- -- print("About to close neo-tree") + -- -- require("neo-tree.command").execute({ action = "close" }) + -- -- end + -- --}, + -- event = "neo_tree_buffer_enter", + -- handler = function() + -- vim.opt_local.relativenumber = true + -- print('Here we are') + -- end, + + --} + }) end diff --git a/lua/user/configs/noice-config.lua b/lua/user/configs/noice-config.lua index 0e0bcfe..4601f49 100644 --- a/lua/user/configs/noice-config.lua +++ b/lua/user/configs/noice-config.lua @@ -5,8 +5,8 @@ return function() cmdline = { enabled = true, -- enables the Noice cmdline UI view = "cmdline_popup", -- view for rendering the cmdline. Change to `cmdline` to get a classic cmdline at the bottom - opts = {}, -- global options for the cmdline. See section on views - ---@type table + opts = {}, -- global options for the cmdline. See section on views + ---@type table format = { -- conceal: (default=true) This will hide the text in the cmdline that matches the pattern. -- view: (default is cmdline view) @@ -26,8 +26,8 @@ return function() messages = { -- NOTE: If you enable messages, then the cmdline is enabled automatically. -- This is a current Neovim limitation. - enabled = true, -- enables the Noice messages UI - view = "notify", -- default view for messages + enabled = true, -- enables the Noice messages UI + view = "notify", -- default view for messages view_error = "notify", -- view for errors view_warn = "notify", -- view for warnings view_history = "messages", -- view for :messages @@ -54,7 +54,7 @@ return function() { error = true }, { warning = true }, { event = "msg_show", kind = { "" } }, - { event = "lsp", kind = "message" }, + { event = "lsp", kind = "message" }, }, }, }, @@ -68,7 +68,7 @@ return function() { error = true }, { warning = true }, { event = "msg_show", kind = { "" } }, - { event = "lsp", kind = "message" }, + { event = "lsp", kind = "message" }, }, }, filter_opts = { count = 1 }, @@ -151,7 +151,7 @@ return function() }, markdown = { hover = { - ["|(%S-)|"] = vim.cmd.help, -- vim help links + ["|(%S-)|"] = vim.cmd.help, -- vim help links ["%[.-%]%((%S-)%)"] = require("noice.util").open, -- markdown links }, highlights = { @@ -176,15 +176,23 @@ return function() presets = { -- you can enable a preset by setting it to true, or a table that will override the preset config -- you can also add custom presets that you can enable/disable with enabled=true - bottom_search = false, -- use a classic bottom cmdline for search + bottom_search = true, -- use a classic bottom cmdline for search command_palette = false, -- position the cmdline and popupmenu together long_message_to_split = false, -- long messages will be sent to a split - inc_rename = false, -- enables an input dialog for inc-rename.nvim - lsp_doc_border = false, -- add a border to hover docs and signature help + inc_rename = false, -- enables an input dialog for inc-rename.nvim + lsp_doc_border = true, -- add a border to hover docs and signature help + + }, throttle = 1000 / 30, -- how frequently does Noice need to check for ui updates? This has no effect when in blocking mode. ---@type NoiceConfigViews - views = {}, ---@see section on views + views = { + mini = { + win_options = { + winblend = 100, + } + } + }, ---@see section on views ---@type NoiceRouteConfig[] routes = {}, --- @see section on routes ---@type table diff --git a/lua/user/configs/notify-config.lua b/lua/user/configs/notify-config.lua index ae17e4d..0403523 100644 --- a/lua/user/configs/notify-config.lua +++ b/lua/user/configs/notify-config.lua @@ -1,10 +1,8 @@ return function() - require "notify".setup( - { + require("notify").setup({ - render = "compact" - + render = "compact", - } - ); + background_colour = "#000000", + }) end diff --git a/lua/user/lazy.lua b/lua/user/lazy.lua index a11915d..7b76d3f 100644 --- a/lua/user/lazy.lua +++ b/lua/user/lazy.lua @@ -1,19 +1,19 @@ local fn = vim.fn -local noice_config = require 'user.configs.noice-config' -local notify_config = require 'user.configs.notify-config' -local neo_tree_config = require 'user.configs.neo-tree' -local nivm_window_picker = require 'user.configs.nvim-window-picker' +local noice_config = require("user.configs.noice-config") +local notify_config = require("user.configs.notify-config") +local neo_tree_config = require("user.configs.neo-tree") +local nivm_window_picker = require("user.configs.nvim-window-picker") -local lazypath = vim.fn.stdpath('data') .. '/lazy/lazy.nvim' +local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" if not vim.loop.fs_stat(lazypath) then - vim.fn.system({ - 'git', - 'clone', - '--filter=blob:none', - 'https://github.com/folke/lazy.nvim.git', - '--branch=stable', -- latest stable release - lazypath, - }) + vim.fn.system({ + "git", + "clone", + "--filter=blob:none", + "https://github.com/folke/lazy.nvim.git", + "--branch=stable", -- latest stable release + lazypath, + }) end vim.opt.rtp:prepend(lazypath) @@ -26,268 +26,353 @@ vim.opt.rtp:prepend(lazypath) ----]] -- - -- Install your plugins here -return require('lazy').setup({ - 'wbthomason/packer.nvim', - - -- UI - -- { - -- 'kyazdani42/nvim-tree.lua', - -- dependencies = { - -- 'kyazdani42/nvim-web-devicons', -- optional, for file icons - -- }, - -- tag = 'nightly' -- optional, updated every week. (see issue #1193) - --} - { - 'nvim-neo-tree/neo-tree.nvim', - branch = 'v3.x', - dependencies = { - 'nvim-lua/plenary.nvim', - 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - 'MunifTanjim/nui.nvim', - { - 's1n7ax/nvim-window-picker', - name = 'window-picker', - event = 'VeryLazy', - version = '2.*', - config = nivm_window_picker, - } - }, - config = neo_tree_config - }, - -- { - -- 'nvim-neo-tree/neo-tree.nvim', - -- branch = 'v2.x', - -- dependencies = { - -- 'nvim-lua/plenary.nvim', - -- 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended - -- 'MunifTanjim/nui.nvim', - -- } - --} - - { - 'nvim-telescope/telescope.nvim', - tag = '0.1.5', - -- or , branch = '0.1.x', - dependencies = { - { 'nvim-lua/plenary.nvim', }, - { 'nvim-telescope/telescope-live-grep-args.nvim' }, - } - }, - - 'nvim-telescope/telescope-file-browser.nvim', - - ---- gh github-cli - -- { - -- 'ldelossa/gh.nvim', - -- dependencies = { { 'ldelossa/litee.nvim' } } - --} - - -- { - -- 'harrisoncramer/gitlab.nvim', - -- dependencies = { - -- 'MunifTanjim/nui.nvim', - -- 'nvim-lua/plenary.nvim' - -- }, - -- build = function() require('gitlab').build() end, - -- config = function() - -- require('gitlab').setup() - -- end, - --} - - -- 'lukas-reineke/indent-blankline.nvim' - -- 'nvimdev/indentmini.nvim' - - -- Bars ... - { - 'nvim-lualine/lualine.nvim', - dependencies = { 'kyazdani42/nvim-web-devicons', opt = true } - }, - --Checking if make faulty noice - -- 'fgheng/winbar.nvim' - -- { - -- 'SmiteshP/nvim-navic', - -- dependencies = 'neovim/nvim-lspconfig' - --} - { - 'Bekaboo/dropbar.nvim', --3daffc1 - commit = '3daffc1', - dependencies = { - 'nvim-telescope/telescope-fzf-native.nvim' - } - }, - 'ThePrimeagen/harpoon', - - -- Theme & Stuff - -- 'Rigellute/shades-of-purple.vim' - 'rktjmp/lush.nvim', - { - 'briones-gabriel/darcula-solid.nvim', - dependencies = 'rktjmp/lush.nvim' - }, - { 'projekt0n/github-nvim-theme' }, - { 'catppuccin/nvim', as = 'catppuccin' }, - 'marko-cerovac/material.nvim', - 'Shatur/neovim-ayu', - - -- { - -- 'folke/zen-mode.nvim', - --} - -- 'Mofiqul/dracula.nvim' - - { - 'nvim-treesitter/nvim-treesitter', - build = ':TSUpdate', - config = function() - require('nvim-treesitter.configs').setup({ - ensure_installed = { 'lua' }, - sync_install = true, - auto_install = true, - }) - end, - - }, - 'nvim-treesitter/playground', - 'brenoprata10/nvim-highlight-colors', - -- not 'norcalli/nvim-colorizer.lua' - --{ 'anuvyklack/pretty-fold.nvim', - -- config = function() - -- require('pretty-fold').setup() - -- end - --} - - -- LSP Configurations - -- 'williamboman/nvim-lsp-installer' - { - 'williamboman/mason.nvim', - 'williamboman/mason-lspconfig.nvim', - 'neovim/nvim-lspconfig', - build = ':MasonUpdate' -- :MasonUpdate updates registry contents - }, - { - 'jay-babu/mason-null-ls.nvim', - dependencies = { - 'williamboman/mason.nvim', - 'jose-elias-alvarez/null-ls.nvim', - }, - --config = function() - -- require('nx').setup {} - --end - }, - -- { 'neovim/nvim-lspconfig', -- Configurations for Nvim LSP - -- --after = 'nvim-lsp-installer', - --} - 'tamago324/nlsp-settings.nvim', - -- 'ray-x/lsp_signature.nvim'-- Function signiture - { 'akinsho/flutter-tools.nvim', dependencies = 'nvim-lua/plenary.nvim' }, - 'onsails/lspkind.nvim', - -- 'jose-elias-alvarez/null-ls.nvim' - -- 'MunifTanjim/eslint.nvim' - 'simrat39/symbols-outline.nvim', - 'f-person/git-blame.nvim', - { - 'lewis6991/gitsigns.nvim', - -- tag = 'release' -- To the latest release (do not use this if you build Neovim nightly or dev builds!) - }, - { - 'Equilibris/nx.nvim', - dependencies = { - 'nvim-telescope/telescope.nvim', - }, - --config = function() - -- require('nx').setup {} - --end - }, - -- { - -- 'SmiteshP/nvim-navbuddy', - -- - -- dependencies = { - -- 'neovim/nvim-lspconfig', - -- 'SmiteshP/nvim-navic', - -- 'MunifTanjim/nui.nvim' - -- } - --} - -- 'lvimuser/lsp-inlayhints.nvim' - - -- Debugger - 'mfussenegger/nvim-dap', - { - 'rcarriga/nvim-dap-ui', - dependencies = { - 'mfussenegger/nvim-dap' - } - }, - 'theHamsta/nvim-dap-virtual-text', - 'rcarriga/cmp-dap', - 'leoluz/nvim-dap-go', - 'LiadOz/nvim-dap-repl-highlights', - 'mxsdev/nvim-dap-vscode-js', - - { - 'microsoft/vscode-js-debug', - opt = true, - build = 'npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out' - }, - - { - -- d to dap-ext-vscode JSON decoder - 'Joakker/lua-json5', - build = './install.sh' - }, - -- Recommend - - -- Optional - --replace with noice - -- 'rcarriga/nvim-notify' - - 'tpope/vim-fugitive', - { 'sindrets/diffview.nvim', dependencies = 'nvim-lua/plenary.nvim' }, - - -- Autocompletion - { - 'hrsh7th/nvim-cmp', -- Autocompletion plugin - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', - 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp - }, - 'saadparwaiz1/cmp_luasnip', -- Snippets source for nvim-cmp - 'L3MON4D3/LuaSnip', -- Snippets plugin - - --Colorize ansi output - -- { 'm00qek/baleia.nvim', tag = 'v1.3.0' } - 'norcalli/nvim-terminal.lua', - - { 'stevearc/dressing.nvim' }, - { - 'folke/noice.nvim', - event = 'VimEnter', - config = noice_config, - dependencies = { - -- if you lazy-load any plugin below, make sure to add proper `module='...'` entries - 'MunifTanjim/nui.nvim', - ({ - 'rcarriga/nvim-notify', - config = notify_config, - }), - } - }, - - 'chiedo/vim-case-convert', - - { - "iamcco/markdown-preview.nvim", - cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, - build = "cd app && yarn install", - init = function() - vim.g.mkdp_filetypes = { "markdown" } - end, - ft = { "markdown" }, - }, - --Ghost editor for Google - Chrome - -- ({ - -- 'subnut/nvim-ghost.nvim', - -- build = ':call nvim_ghost#installer#install()' - --}) +return require("lazy").setup({ + --"wbthomason/packer.nvim", + + -- UI + -- { + -- 'kyazdani42/nvim-tree.lua', + -- dependencies = { + -- 'kyazdani42/nvim-web-devicons', -- optional, for file icons + -- }, + -- tag = 'nightly' -- optional, updated every week. (see issue #1193) + --} + { + "nvim-neo-tree/neo-tree.nvim", + branch = "v3.x", + dependencies = { + "nvim-lua/plenary.nvim", + "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended + "MunifTanjim/nui.nvim", + { + "s1n7ax/nvim-window-picker", + name = "window-picker", + event = "VeryLazy", + version = "2.*", + config = nivm_window_picker, + }, + }, + config = neo_tree_config, + }, + -- { + -- 'nvim-neo-tree/neo-tree.nvim', + -- branch = 'v2.x', + -- dependencies = { + -- 'nvim-lua/plenary.nvim', + -- 'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended + -- 'MunifTanjim/nui.nvim', + -- } + --} + + { + "nvim-telescope/telescope.nvim", + tag = "0.1.8", + -- or , branch = '0.1.x', + dependencies = { + { "nvim-lua/plenary.nvim" }, + { "nvim-telescope/telescope-live-grep-args.nvim" }, + }, + }, + --{ + -- 'nvim-telescope/telescope-fzf-native.nvim', + -- build = 'make', + --}, + --'nvim-telescope/telescope-file-browser.nvim', + + ---- gh github-cli + -- { + -- 'ldelossa/gh.nvim', + -- dependencies = { { 'ldelossa/litee.nvim' } } + --} + + -- { + -- 'harrisoncramer/gitlab.nvim', + -- dependencies = { + -- 'MunifTanjim/nui.nvim', + -- 'nvim-lua/plenary.nvim' + -- }, + -- build = function() require('gitlab').build() end, + -- config = function() + -- require('gitlab').setup() + -- end, + --} + + -- 'lukas-reineke/indent-blankline.nvim' + -- 'nvimdev/indentmini.nvim' + + -- Bars ... + { + "nvim-lualine/lualine.nvim", + dependencies = { "kyazdani42/nvim-web-devicons", opt = true }, + }, + --Checking if make faulty noice + -- 'fgheng/winbar.nvim' + -- { + -- 'SmiteshP/nvim-navic', + -- dependencies = 'neovim/nvim-lspconfig' + --} + + --Fancy bread crumb : )))))) + --{ + -- "Bekaboo/dropbar.nvim", --3daffc1 + -- commit = "3daffc1", + -- dependencies = { + -- "nvim-telescope/telescope-fzf-native.nvim", + -- build = "make", + -- }, + --}, + "ThePrimeagen/harpoon", + + "luukvbaal/statuscol.nvim", + + -- Theme & Stuff + "Rigellute/shades-of-purple.vim", + "rktjmp/lush.nvim", + { + "briones-gabriel/darcula-solid.nvim", + dependencies = "rktjmp/lush.nvim", + }, + { "projekt0n/github-nvim-theme" }, + { "catppuccin/nvim", as = "catppuccin" }, + "marko-cerovac/material.nvim", + "Shatur/neovim-ayu", + + -- { + -- 'folke/zen-mode.nvim', + --} + "Mofiqul/dracula.nvim", + + { + "nvim-treesitter/nvim-treesitter", + build = ":TSUpdate", + --config = function() + -- require('nvim-treesitter.configs').setup({ + -- ensure_installed = { 'lua' }, + -- sync_install = true, + -- auto_install = true, + -- }) + --end, + }, + { + "kevinhwang91/nvim-ufo", + dependencies = "kevinhwang91/promise-async", + }, + "nvim-treesitter/playground", + "brenoprata10/nvim-highlight-colors", + -- not 'norcalli/nvim-colorizer.lua' + --{ 'anuvyklack/pretty-fold.nvim', + -- config = function() + -- require('pretty-fold').setup() + -- end + --} + + -- LSP Configurations + -- 'williamboman/nvim-lsp-installer' + "davidmh/cspell.nvim", + { + "williamboman/mason.nvim", + "williamboman/mason-lspconfig.nvim", + "neovim/nvim-lspconfig", + build = ":MasonUpdate", -- :MasonUpdate updates registry contents + }, + + "stevearc/conform.nvim", + "zapling/mason-conform.nvim", + --"mfussenegger/nvim-lint", + --"rshkarin/mason-nvim-lint", + { + "nvimtools/none-ls.nvim", + "jay-babu/mason-null-ls.nvim", + event = { "BufReadPre", "BufNewFile" }, + dependencies = { + "williamboman/mason.nvim", + "nvimtools/none-ls.nvim", + }, + --config = function() + -- require("your.null-ls.config") -- require your null-ls config here (example below) + --end, + }, + { "folke/neodev.nvim", opts = {} }, + -- { 'neovim/nvim-lspconfig', -- Configurations for Nvim LSP + -- --after = 'nvim-lsp-installer', + --} + "tamago324/nlsp-settings.nvim", + -- 'ray-x/lsp_signature.nvim'-- Function signiture + { + "akinsho/flutter-tools.nvim", + lazy = false, + dependencies = { + "nvim-lua/plenary.nvim", + "stevearc/dressing.nvim", -- optional for vim.ui.select + }, + config = true, + }, + "onsails/lspkind.nvim", + "simrat39/symbols-outline.nvim", + "f-person/git-blame.nvim", + { + "lewis6991/gitsigns.nvim", + -- tag = 'release' -- To the latest release (do not use this if you build Neovim nightly or dev builds!) + }, + { + "Equilibris/nx.nvim", + dependencies = { + "nvim-telescope/telescope.nvim", + }, + --config = function() + -- require('nx').setup {} + --end + }, + -- { + -- 'SmiteshP/nvim-navbuddy', + -- + -- dependencies = { + -- 'neovim/nvim-lspconfig', + -- 'SmiteshP/nvim-navic', + -- 'MunifTanjim/nui.nvim' + -- } + --} + -- 'lvimuser/lsp-inlayhints.nvim' + "MysticalDevil/inlay-hints.nvim", + + -- Debugger + "mfussenegger/nvim-dap", + { + "rcarriga/nvim-dap-ui", + dependencies = { + "mfussenegger/nvim-dap", + "nvim-neotest/nvim-nio", + }, + }, + "theHamsta/nvim-dap-virtual-text", + "rcarriga/cmp-dap", + "leoluz/nvim-dap-go", + "LiadOz/nvim-dap-repl-highlights", + --'mxsdev/nvim-dap-vscode-js', + + --{ + -- 'microsoft/vscode-js-debug', + -- build = 'npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out' + --}, + { + "microsoft/vscode-js-debug", + -- After install, build it and rename the dist directory to out + build = "npm install --legacy-peer-deps --no-save && npx gulp vsDebugServerBundle && rm -rf out && mv dist out", + version = "1.*", + }, + { + "mxsdev/nvim-dap-vscode-js", + config = function() + ---@diagnostic disable-next-line: missing-fields + require("dap-vscode-js").setup({ + -- Path of node executable. Defaults to $NODE_PATH, and then "node" + -- node_path = "node", + + -- Path to vscode-js-debug installation. + debugger_path = vim.fn.resolve(vim.fn.stdpath("data") .. "/lazy/vscode-js-debug"), + + -- Command to use to launch the debug server. Takes precedence over "node_path" and "debugger_path" + -- debugger_cmd = { "js-debug-adapter" }, + + -- which adapters to register in nvim-dap + adapters = { + "chrome", + "pwa-node", + "pwa-chrome", + "pwa-msedge", + "pwa-extensionHost", + "node-terminal", + }, + + -- Path for file logging + -- log_file_path = "(stdpath cache)/dap_vscode_js.log", + + -- Logging level for output to file. Set to false to disable logging. + -- log_file_level = false, + + -- Logging level for output to console. Set to false to disable console output. + -- log_console_level = vim.log.levels.ERROR, + }) + end, + }, + + { + -- d to dap-ext-vscode JSON decoder + "Joakker/lua-json5", + build = "./install.sh", + }, + -- Recommend + + -- Optional + --replace with noice + -- 'rcarriga/nvim-notify' + + "tpope/vim-fugitive", + { "sindrets/diffview.nvim", dependencies = "nvim-lua/plenary.nvim" }, + + -- Autocompletion + { + "hrsh7th/nvim-cmp", -- Autocompletion plugin + "hrsh7th/cmp-buffer", + "hrsh7th/cmp-path", + "hrsh7th/cmp-cmdline", + "hrsh7th/cmp-nvim-lsp", -- LSP source for nvim-cmp + }, + "saadparwaiz1/cmp_luasnip", -- Snippets source for nvim-cmp + "L3MON4D3/LuaSnip", -- Snippets plugin + + --Colorize ansi output + -- { 'm00qek/baleia.nvim', tag = 'v1.3.0' } + "norcalli/nvim-terminal.lua", + + { "stevearc/dressing.nvim" }, + { + "folke/noice.nvim", + event = "VimEnter", + config = noice_config, + dependencies = { + -- if you lazy-load any plugin below, make sure to add proper `module='...'` entries + "MunifTanjim/nui.nvim", + { + "rcarriga/nvim-notify", + config = notify_config, + }, + }, + }, + + "chiedo/vim-case-convert", + + --{ + -- 'kristijanhusak/vim-dadbod-ui', + -- dependencies = { + -- { 'tpope/vim-dadbod', lazy = true }, + -- { 'kristijanhusak/vim-dadbod-completion', ft = { 'sql', 'mysql', 'plsql' }, lazy = true }, + -- }, + -- cmd = { + -- 'DBUI', + -- 'DBUIToggle', + -- 'DBUIAddConnection', + -- 'DBUIFindBuffer', + -- }, + -- init = function() + -- -- Your DBUI configuration + -- vim.g.db_ui_use_nerd_fonts = 1 + -- end, + --}, + + { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + build = "cd app && yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end, + ft = { "markdown" }, + }, + --Ghost editor for Google - Chrome + -- ({ + -- 'subnut/nvim-ghost.nvim', + -- build = ':call nvim_ghost#installer#install()' + --}) }) diff --git a/lua/user/lsp.lua b/lua/user/lsp.lua index 852ef0d..ec58d7a 100644 --- a/lua/user/lsp.lua +++ b/lua/user/lsp.lua @@ -3,19 +3,19 @@ --local lsp_sig = require('lsp_signature') require("mason").setup() -require('mason-lspconfig').setup {} - -local use = require('packer').use -require('packer').startup(function() - use 'neovim/nvim-lspconfig' -- Collection of configurations for built-in LSP client - use 'hrsh7th/nvim-cmp' -- Autocompletion plugin - use 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp - use 'saadparwaiz1/cmp_luasnip' -- Snippets source for nvim-cmp - use 'L3MON4D3/LuaSnip' -- Snippets plugin - use 'hrsh7th/cmp-buffer' - use 'hrsh7th/cmp-path' - use 'hrsh7th/cmp-cmdline' -end) +require("mason-lspconfig").setup({}) + +--ocal use = require("packer").use +--require("packer").startup(function() +-- use("neovim/nvim-lspconfig") -- Collection of configurations for built-in LSP client +-- use("hrsh7th/nvim-cmp") -- Autocompletion plugin +-- use("hrsh7th/cmp-nvim-lsp") -- LSP source for nvim-cmp +-- use("saadparwaiz1/cmp_luasnip") -- Snippets source for nvim-cmp +-- use("L3MON4D3/LuaSnip") -- Snippets plugin +-- use("hrsh7th/cmp-buffer") +-- use("hrsh7th/cmp-path") +-- use("hrsh7th/cmp-cmdline") +--end) --require "lsp-inlayhints".setup { -- inlay_hints = { @@ -83,33 +83,35 @@ end --local capabilities = vim.lsp.protocol.make_client_capabilities() --capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) -local capabilities = require('cmp_nvim_lsp').default_capabilities() +local capabilities = require("cmp_nvim_lsp").default_capabilities() -- Mappings. -- See `:help vim.diagnostic.*` for documentation on any of the below functions local opts = { noremap = true, silent = true } -vim.keymap.set('n', 'e', vim.diagnostic.open_float, opts) -vim.keymap.set('n', '', vim.diagnostic.goto_prev, opts) -vim.keymap.set('n', '', vim.diagnostic.goto_next, opts) -vim.keymap.set('n', 'q', vim.diagnostic.setloclist, opts) +vim.keymap.set("n", "e", vim.diagnostic.open_float, opts) +vim.keymap.set("n", "", vim.diagnostic.goto_prev, opts) +vim.keymap.set("n", "", vim.diagnostic.goto_next, opts) +vim.keymap.set("n", "q", vim.diagnostic.setloclist, opts) local bufopts = { noremap = true, silent = true } -vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts) -vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts) +vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts) +vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts) --vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts) --vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts) --vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts) -vim.keymap.set('i', '', vim.lsp.buf.signature_help, bufopts) -vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, bufopts) -vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, bufopts) -vim.keymap.set('n', 'wl', function() +vim.keymap.set("i", "", vim.lsp.buf.signature_help, bufopts) +vim.keymap.set("n", "wa", vim.lsp.buf.add_workspace_folder, bufopts) +vim.keymap.set("n", "wr", vim.lsp.buf.remove_workspace_folder, bufopts) +vim.keymap.set("n", "wl", function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, bufopts) -vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, bufopts) -vim.keymap.set('n', '', vim.lsp.buf.rename, bufopts) -vim.keymap.set('n', 'a', vim.lsp.buf.code_action, bufopts) -vim.keymap.set('n', 'f', vim.lsp.buf.format, bufopts) -vim.keymap.set('n', 'i', function() vim.lsp.buf.inlay_hint(0) end, bufopts) +vim.keymap.set("n", "D", vim.lsp.buf.type_definition, bufopts) +vim.keymap.set("n", "", vim.lsp.buf.rename, bufopts) +vim.keymap.set("n", "a", vim.lsp.buf.code_action, bufopts) +vim.keymap.set("n", "f", vim.lsp.buf.format, bufopts) +vim.keymap.set("n", "i", function() + vim.lsp.buf.inlay_hint(0) +end, bufopts) --vim.keymap.set('n', 'e', vim.lsp.diagnostic.show_position_diagnostics, bufopts) --vim.cmd([[autocmd CursorHold lua vim.lsp.buf.document_highlight()]]) @@ -127,7 +129,7 @@ local function print_table(node) local cur_index = 1 for k, v in pairs(node) do if (cache[node] == nil) or (cur_index >= cache[node]) then - if (string.find(output_str, "}", output_str:len())) then + if string.find(output_str, "}", output_str:len()) then output_str = output_str .. ",\n" elseif not (string.find(output_str, "\n", output_str:len())) then output_str = output_str .. "\n" @@ -138,44 +140,44 @@ local function print_table(node) output_str = "" local key - if (type(k) == "number" or type(k) == "boolean") then + if type(k) == "number" or type(k) == "boolean" then key = "[" .. tostring(k) .. "]" else key = "['" .. tostring(k) .. "']" end - if (type(v) == "number" or type(v) == "boolean") then - output_str = output_str .. string.rep('\t', depth) .. key .. " = " .. tostring(v) - elseif (type(v) == "table") then - output_str = output_str .. string.rep('\t', depth) .. key .. " = {\n" + if type(v) == "number" or type(v) == "boolean" then + output_str = output_str .. string.rep("\t", depth) .. key .. " = " .. tostring(v) + elseif type(v) == "table" then + output_str = output_str .. string.rep("\t", depth) .. key .. " = {\n" table.insert(stack, node) table.insert(stack, v) cache[node] = cur_index + 1 break else - output_str = output_str .. string.rep('\t', depth) .. key .. " = '" .. tostring(v) .. "'" + output_str = output_str .. string.rep("\t", depth) .. key .. " = '" .. tostring(v) .. "'" end - if (cur_index == size) then - output_str = output_str .. "\n" .. string.rep('\t', depth - 1) .. "}" + if cur_index == size then + output_str = output_str .. "\n" .. string.rep("\t", depth - 1) .. "}" else output_str = output_str .. "," end else -- close the table - if (cur_index == size) then - output_str = output_str .. "\n" .. string.rep('\t', depth - 1) .. "}" + if cur_index == size then + output_str = output_str .. "\n" .. string.rep("\t", depth - 1) .. "}" end end cur_index = cur_index + 1 end - if (size == 0) then - output_str = output_str .. "\n" .. string.rep('\t', depth - 1) .. "}" + if size == 0 then + output_str = output_str .. "\n" .. string.rep("\t", depth - 1) .. "}" end - if (#stack > 0) then + if #stack > 0 then node = stack[#stack] stack[#stack] = nil depth = cache[node] == nil and depth + 1 or depth - 1 @@ -191,13 +193,12 @@ local function print_table(node) --print(output_str) end - -- 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) --lsp_sig.on_attach(client, bufnr) -- Enable completion triggered by - vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc') + vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc") -- Mappings. -- See `:help vim.lsp.*` for documentation on any of the below functions @@ -267,7 +268,7 @@ local on_attach = function(client, bufnr) buffer = bufnr, callback = function() vim.lsp.buf.document_highlight() - end + end, }) vim.api.nvim_create_autocmd("CursorMoved", { @@ -275,7 +276,7 @@ local on_attach = function(client, bufnr) buffer = bufnr, callback = function() vim.lsp.buf.clear_references() - end + end, }) end --require("lsp-inlayhints").on_attach(client, bufnr) @@ -312,7 +313,7 @@ end -- --filetypes = {"js", "ts", "jsx", "tsx", "json", "json5"} --} -- -require 'lspconfig'.rust_analyzer.setup { +require("lspconfig").rust_analyzer.setup({ on_attach = on_attach, capabilities = capabilities, --cmd = {'~/.local/bin/rust-analyzer'} @@ -330,65 +331,110 @@ require 'lspconfig'.rust_analyzer.setup { }, }, procMacro = { - enable = true + enable = true, }, - } - } -} + }, + }, +}) +-- IMPORTANT: make sure to setup neodev BEFORE lspconfig +require("neodev").setup({ + -- add any options here, or leave empty to use the default settings +}) -require 'lspconfig'.lua_ls.setup { +require("lspconfig").lua_ls.setup({ on_attach = on_attach, capabilities = capabilities, settings = { Lua = { library = { "/usr/share/nvim/runtime/lua", - "/usr/share/nvim/runtime/lua/vim/lsp" + "/usr/share/nvim/runtime/lua/vim/lsp", }, diagnostics = { - globals = { 'vim' } - } - } - } -} + globals = { "vim" }, + }, -require 'lspconfig'.gopls.setup { + completion = { + callSnippet = "Replace", + }, + }, + }, +}) +require("lspconfig").gopls.setup({ settings = { gopls = { + analyses = { + unusedparams = true, + }, + staticcheck = true, + gofumpt = true, hints = { assignVariableTypes = true, compositeLiteralFields = true, constantValues = true, functionTypeParameters = true, parameterNames = true, - rangeVariableTypes = true + rangeVariableTypes = true, }, }, }, on_attach = on_attach, capabilities = capabilities, -} +}) + +--require("lspconfig").tsserver.setup({ +require("lspconfig").ts_ls.setup({ + capabilities = capabilities, + on_attach = on_attach, + settings = { + + typescript = { + inlayHints = { + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + javascript = { + inlayHints = { + includeInlayParameterNameHints = "all", + includeInlayParameterNameHintsWhenArgumentMatchesName = true, + includeInlayFunctionParameterTypeHints = true, + includeInlayVariableTypeHints = true, + includeInlayVariableTypeHintsWhenTypeMatchesName = true, + includeInlayPropertyDeclarationTypeHints = true, + includeInlayFunctionLikeReturnTypeHints = true, + includeInlayEnumMemberValueHints = true, + }, + }, + }, +}) local servers = { --'cspell', --'eslint', --'grammarly', --buf', - 'html', - 'lua_ls', - 'svelte', + "html", + "lua_ls", + "svelte", --'tailwindcss', - 'tsserver', - 'cssls', + --"ts_ls", + "cssls", --'buf_language_server', - 'bufls' + "bufls", } for _, lsp in ipairs(servers) do - require('lspconfig')[lsp].setup { + require("lspconfig")[lsp].setup({ on_attach = on_attach, capabilities = capabilities, - } + }) end --local eslint_config = require("lspconfig.server_configurations.eslint") diff --git a/lua/user/mapping/telescope-mapping.lua b/lua/user/mapping/telescope-mapping.lua index b6ebadc..ffa6910 100644 --- a/lua/user/mapping/telescope-mapping.lua +++ b/lua/user/mapping/telescope-mapping.lua @@ -9,43 +9,47 @@ vim.keymap.set('n', "bb", ':Telescope buffers', opts) vim.keymap.set('n', "g", ':Telescope live_grep', opts) --vim.keymap.set('n', "o", ':Telescope lsp_document_symbols', opts) vim.keymap.set('n', "o", function() - require('telescope.builtin').lsp_document_symbols( + require('telescope.builtin').lsp_document_symbols( - ---@param opts table: options to pass to the picker - ---@field fname_width number: defines the width of the filename section (default: 30) - ---@field symbol_width number: defines the width of the symbol section (default: 25) - ---@field symbol_type_width number: defines the width of the symbol type section (default: 8) - ---@field show_line boolean: if true, shows the content of the line the tag is found on (default: false) - ---@field symbols string|table: filter results by symbol kind(s) - ---@field ignore_symbols string|table: list of symbols to ignore - ---@field symbol_highlights table: string -> string. Matches symbol with hl_group - ---@field file_encoding string: file encoding for the previewer - { - opts = { - show_line = true, - ignore_symbols = { 'variable' }, - }, - }) + ---@param opts table: options to pass to the picker + ---@field fname_width number: defines the width of the filename section (default: 30) + ---@field symbol_width number: defines the width of the symbol section (default: 25) + ---@field symbol_type_width number: defines the width of the symbol type section (default: 8) + ---@field show_line boolean: if true, shows the content of the line the tag is found on (default: false) + ---@field symbols string|table: filter results by symbol kind(s) + ---@field ignore_symbols string|table: list of symbols to ignore + ---@field symbol_highlights table: string -> string. Matches symbol with hl_group + ---@field file_encoding string: file encoding for the previewer + { + opts = { + show_line = true, + ignore_symbols = { 'variable' }, + }, + }) end, opts) vim.keymap.set('n', "m", function() - local pickerOpts = require('telescope.themes').get_dropdown({ winblend = 15 }) - pickerOpts.show_line = false - pickerOpts.symbols = { "method", "function" } - require('telescope.builtin').lsp_document_symbols( - pickerOpts - ---@param opts table: options to pass to the picker - ---@field fname_width number: defines the width of the filename section (default: 30) - ---@field symbol_width number: defines the width of the symbol section (default: 25) - ---@field symbol_type_width number: defines the width of the symbol type section (default: 8) - ---@field show_line boolean: if true, shows the content of the line the tag is found on (default: false) - ---@field symbols string|table: filter results by symbol kind(s) - ---@field ignore_symbols string|table: list of symbols to ignore - ---@field symbol_highlights table: string -> string. Matches symbol with hl_group - ---@field file_encoding string: file encoding for the previewer - ) - print(vim.inspect(pickerOpts)) + --local pickerOpts = require('telescope.themes').get_dropdown({ + -- winblend = 10, + -- width = 0.9, + -- results_height = 15, + --}) + --pickerOpts.show_line = false + --pickerOpts.symbols = { "method", "function" } + require('telescope.builtin').lsp_document_symbols( + --pickerOpts + ---@param opts table: options to pass to the picker + ---@field fname_width number: defines the width of the filename section (default: 30) + ---@field symbol_width number: defines the width of the symbol section (default: 25) + ---@field symbol_type_width number: defines the width of the symbol type section (default: 8) + ---@field show_line boolean: if true, shows the content of the line the tag is found on (default: false) + ---@field symbols string|table: filter results by symbol kind(s) + ---@field ignore_symbols string|table: list of symbols to ignore + ---@field symbol_highlights table: string -> string. Matches symbol with hl_group + ---@field file_encoding string: file encoding for the previewer + ) + --print(vim.inspect(pickerOpts)) end, opts) vim.keymap.set('n', "s", ':Telescope lsp_workspace_symbols', opts) @@ -55,17 +59,17 @@ vim.keymap.set('n', "d", ':Telescope diagnostics', opts) vim.keymap.set('n', "gi", ':Telescope lsp_implementations', opts) vim.keymap.set('n', "gd", function() - require('telescope.builtin').lsp_definitions({ - --- Goto the definition of the word under the cursor, if there's only one, otherwise show all options in Telescope - ---@param opts table: options to pass to the picker - ---@field jump_type string: how to goto definition if there is only one and the definition file is different from the current file, values: "tab", "split", "vsplit", "never" - ---@field fname_width number: defines the width of the filename section (default: 30) - ---@field show_line boolean: show results text (default: true) - ---@field trim_text boolean: trim results text (default: false) - ---@field file_encoding string: file encoding for the previewer - show_line = true, - fname_width = 80, - }) + require('telescope.builtin').lsp_definitions({ + --- Goto the definition of the word under the cursor, if there's only one, otherwise show all options in Telescope + ---@param opts table: options to pass to the picker + ---@field jump_type string: how to goto definition if there is only one and the definition file is different from the current file, values: "tab", "split", "vsplit", "never" + ---@field fname_width number: defines the width of the filename section (default: 30) + ---@field show_line boolean: show results text (default: true) + ---@field trim_text boolean: trim results text (default: false) + ---@field file_encoding string: file encoding for the previewer + show_line = true, + fname_width = 80, + }) end, opts) vim.keymap.set('n', "gw", require('telescope.builtin').grep_string, opts) @@ -73,35 +77,35 @@ vim.keymap.set('n', "gs", require('telescope.builtin').git_status, opts) --vim.keymap.set('n', "gr", ':Telescope lsp_references', opts) vim.keymap.set('n', "gr", function() - require('telescope.builtin').lsp_references({ - --- Lists LSP references for word under the cursor, jumps to reference on `` - ---@param opts table: options to pass to the picker - ---@field include_declaration boolean: include symbol declaration in the lsp references (default: true) - ---@field include_current_line boolean: include current line (default: false) - ---@field fname_width number: defines the width of the filename section (default: 30) - ---@field show_line boolean: show results text (default: true) - ---@field trim_text boolean: trim results text (default: false) - ---@field file_encoding string: file encoding for the previewer - show_line = false, - include_current_line = true, - fname_width = 80, - }) + require('telescope.builtin').lsp_references({ + --- Lists LSP references for word under the cursor, jumps to reference on `` + ---@param opts table: options to pass to the picker + ---@field include_declaration boolean: include symbol declaration in the lsp references (default: true) + ---@field include_current_line boolean: include current line (default: false) + ---@field fname_width number: defines the width of the filename section (default: 30) + ---@field show_line boolean: show results text (default: true) + ---@field trim_text boolean: trim results text (default: false) + ---@field file_encoding string: file encoding for the previewer + show_line = false, + include_current_line = true, + fname_width = 80, + }) end, opts) vim.keymap.set('n', "w", function() - require('telescope.builtin').lsp_dynamic_workspace_symbols({ + require('telescope.builtin').lsp_dynamic_workspace_symbols({ - ---@param opts table: options to pass to the picker - ---@field fname_width number: defines the width of the filename section (default: 30) - ---@field symbol_width number: defines the width of the symbol section (default: 25) - ---@field symbol_type_width number: defines the width of the symbol type section (default: 8) - ---@field show_line boolean: if true, shows the content of the line the tag is found on (default: false) - ---@field symbols string|table: filter results by symbol kind(s) - ---@field ignore_symbols string|table: list of symbols to ignore - ---@field symbol_highlights table: string -> string. Matches symbol with hl_group - ---@field file_encoding string: file encoding for the previewer - show_line = false, - ignore_symbols = { 'variable' }, - }) + ---@param opts table: options to pass to the picker + ---@field fname_width number: defines the width of the filename section (default: 30) + ---@field symbol_width number: defines the width of the symbol section (default: 25) + ---@field symbol_type_width number: defines the width of the symbol type section (default: 8) + ---@field show_line boolean: if true, shows the content of the line the tag is found on (default: false) + ---@field symbols string|table: filter results by symbol kind(s) + ---@field ignore_symbols string|table: list of symbols to ignore + ---@field symbol_highlights table: string -> string. Matches symbol with hl_group + ---@field file_encoding string: file encoding for the previewer + show_line = false, + ignore_symbols = { 'variable' }, + }) end, opts) diff --git a/lua/user/nvim-cmp.lua b/lua/user/nvim-cmp.lua index fdf4f72..2324efe 100644 --- a/lua/user/nvim-cmp.lua +++ b/lua/user/nvim-cmp.lua @@ -1,14 +1,14 @@ -local use = require('packer').use -require('packer').startup(function() - use 'neovim/nvim-lspconfig' -- Collection of configurations for built-in LSP client - use 'hrsh7th/nvim-cmp' -- Autocompletion plugin - use 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp - use 'saadparwaiz1/cmp_luasnip' -- Snippets source for nvim-cmp - use 'L3MON4D3/LuaSnip' -- Snippets plugin - use 'hrsh7th/cmp-buffer' - use 'hrsh7th/cmp-path' - use 'hrsh7th/cmp-cmdline' -end) +--local use = require('packer').use +--require('packer').startup(function() +-- use 'neovim/nvim-lspconfig' -- Collection of configurations for built-in LSP client +-- use 'hrsh7th/nvim-cmp' -- Autocompletion plugin +-- use 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp +-- use 'saadparwaiz1/cmp_luasnip' -- Snippets source for nvim-cmp +-- use 'L3MON4D3/LuaSnip' -- Snippets plugin +-- use 'hrsh7th/cmp-buffer' +-- use 'hrsh7th/cmp-path' +-- use 'hrsh7th/cmp-cmdline' +--end) local lspkind = require('lspkind') lspkind.init({ @@ -159,5 +159,6 @@ cmp.setup { sources = { { name = 'nvim_lsp' }, { name = 'luasnip' }, + --{ name = 'vim-dadbod-completion'} }, } diff --git a/lua/user/options.lua b/lua/user/options.lua index 474b84f..bc6ce17 100644 --- a/lua/user/options.lua +++ b/lua/user/options.lua @@ -1,158 +1,183 @@ local options = { - backup = false, -- creates a backup file - clipboard = "unnamedplus", -- allows neovim to access the system clipboard - cmdheight = 0, -- more space in the neovim command line for displaying messages - completeopt = { "menuone", "noselect" }, -- mostly just for cmp - conceallevel = 2, -- so that ``` is visible in markdown files - -- colorcolumn = "80", - -- colorcolumn = "120", - fileencoding = "utf-8", -- the encoding written to a file - hlsearch = true, -- highlight all matches on previous search pattern - ignorecase = true, -- ignore case in search patterns - mouse = "a", -- allow the mouse to be used in neovim - mousemodel = "extend", - pumheight = 10, -- pop up menu height - showmode = false, -- we don't need to see things like -- INSERT -- anymore - showtabline = 0, -- always show tabs - smartcase = true, -- smart case - smartindent = true, -- make indenting smarter again - splitbelow = false, -- force all horizontal splits to go below current window - splitright = false, -- force all vertical splits to go to the right of current window - swapfile = false, -- creates a swapfile - termguicolors = true, -- set term gui colors (most terminals support this) - timeoutlen = 500, -- time to wait for a mapped sequence to complete (in milliseconds) - undofile = true, -- enable persistent undo - updatetime = 300, -- faster completion (4000ms default) - writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited - expandtab = true, -- convert tabs to spaces - shiftwidth = 2, -- the number of spaces inserted for each indentation - tabstop = 2, -- insert 2 spaces for a tab - cursorline = true, -- highlight the current line - number = true, -- set numbered lines - laststatus = 0, - showcmd = false, - ruler = false, - relativenumber = true, -- set relative numbered lines - numberwidth = 4, -- set number column width to 2 {default 4} - signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time - wrap = false, -- display lines as one long line - --scrolloff = 8, -- - --sidescrolloff = 8, - guifont = "monospace:h17", -- the font used in graphical neovim applications + backup = false, -- creates a backup file + clipboard = "unnamedplus", -- allows neovim to access the system clipboard + cmdheight = 0, -- more space in the neovim command line for displaying messages + completeopt = { "menuone", "noselect" }, -- mostly just for cmp + conceallevel = 2, -- so that ``` is visible in markdown files + -- colorcolumn = "80", + -- colorcolumn = "120", + fileencoding = "utf-8", -- the encoding written to a file + hlsearch = true, -- highlight all matches on previous search pattern + ignorecase = true, -- ignore case in search patterns + --mouse = "a", -- allow the mouse to be used in neovim + mousemodel = "extend", + pumheight = 10, -- pop up menu height + showmode = false, -- we don't need to see things like -- INSERT -- anymore + showtabline = 0, -- always show tabs + smartcase = true, -- smart case + smartindent = true, -- make indenting smarter again + splitbelow = false, -- force all horizontal splits to go below current window + splitright = false, -- force all vertical splits to go to the right of current window + swapfile = false, -- creates a swapfile + termguicolors = true, -- set term gui colors (most terminals support this) + timeoutlen = 500, -- time to wait for a mapped sequence to complete (in milliseconds) + undofile = true, -- enable persistent undo + updatetime = 300, -- faster completion (4000ms default) + writebackup = false, -- if a file is being edited by another program (or was written to file while editing with another program), it is not allowed to be edited + expandtab = true, -- convert tabs to spaces + shiftwidth = 2, -- the number of spaces inserted for each indentation + tabstop = 2, -- insert 2 spaces for a tab + cursorline = true, -- highlight the current line + number = true, -- set numbered lines + laststatus = 0, + showcmd = false, + ruler = false, + relativenumber = true, -- set relative numbered lines + numberwidth = 4, -- set number column width to 2 {default 4} + signcolumn = "yes", -- always show the sign column, otherwise it would shift the text each time + wrap = false, -- display lines as one long line + --scrolloff = 8, -- + --sidescrolloff = 8, + guifont = "monospace:h17", -- the font used in graphical neovim applications } vim.cmd("set noarabicshape") vim.cmd("set noarabic") vim.cmd("set termbidi") vim.o.mouse = "a" -vim.o.fillchars = "vert:▏,eob: " +vim.o.fillchars = "vert:▏,eob: ,fold: ,foldopen:,foldsep: ,foldclose:" vim.g.loaded_netrw = 1 vim.g.loaded_netrwPlugin = 1 ---vim.opt.fillchars.eob="\\ " -vim.opt.shortmess:append "c" +--vim.o.foldcolumn = "0" -- '0' is not bad +--vim.o.foldlevel = 1 -- Using ufo provider need a large value, feel free to decrease the value +--vim.o.foldlevelstart = 99 +--vim.o.foldenable = true + +vim.opt.shortmess:append("c") for k, v in pairs(options) do - vim.opt[k] = v + vim.opt[k] = v end -vim.cmd "set whichwrap+=<,>,[,],h,l" -vim.cmd [[set iskeyword+=-]] -vim.cmd [[set formatoptions-=cro]] -- TODO: this doesn't seem to work +vim.cmd("set whichwrap+=<,>,[,],h,l") +vim.cmd([[set iskeyword+=-]]) +vim.cmd([[set formatoptions-=cro]]) -- TODO: this doesn't seem to work vim.filetype.add({ - extension = { - conf = "dosini", - }, + extension = { + conf = "dosini", + }, }) -----vim.cmd('colorscheme shades_of_purple') -------Shade of purple customization's -----vim.cmd('hi LineNr ctermfg=140 ctermbg=235 guifg=#a599e9 guibg=#2d2b55') -----vim.cmd('hi VertSplit ctermfg=140 ctermbg=235 guifg=#302e54 guibg=#2d2b55') -------hi WinSeparator guifg=#ff0000 -------vim.cmd('hi WinSeparator guifg=#00aaff guibg=#2d2b55') -----vim.cmd('hi SignColumn ctermfg=140 ctermbg=235 guifg=#a599e9 guibg=#2d2b55') --- +--vim.cmd('colorscheme shades_of_purple') +----Shade of purple customization's +--vim.cmd('hi LineNr ctermfg=140 ctermbg=235 guifg=#a599e9 guibg=#2d2b55') +--vim.cmd('hi VertSplit ctermfg=140 ctermbg=235 guifg=#302e54 guibg=#2d2b55') +----hi WinSeparator guifg=#ff0000 +----vim.cmd('hi WinSeparator guifg=#00aaff guibg=#2d2b55') +--vim.cmd('hi SignColumn ctermfg=140 ctermbg=235 guifg=#a599e9 guibg=#2d2b55') +---- + ---- Normal xxx guifg=#ced1d4 guibg=#262627 ---- NormalNC xxx guifg=#ced1d4 guibg=#232324 ---vim.cmd('colorscheme darcula-solid') +vim.cmd("colorscheme darcula-solid") --vim.cmd('hi Normal guifg=#ced1d4 guibg=#232324') --vim.cmd('hi NormalNC guifg=#ced1d4 guibg=#232324') ---vim.cmd('hi CursorLine guibg=Grey10') ---vim.cmd('hi Visual guibg=Grey30') ---vim.cmd('hi! link Type Structure'); ---vim.cmd('hi! link @property Structure'); ---vim.cmd('hi! link @variable.builtin Keyword'); ---vim.cmd('hi! link @constructor @tag'); ---vim.cmd('hi! LspInlayHint guifg=#aaaa00 guibg=#4d4d4d'); ---vim.cmd('hi! Statement guifg=#cd7832 gui=italic') -----CursorLine xxx cterm=underline guibg=Grey40 --- +vim.cmd("hi CursorLine guibg=Grey10") +vim.cmd("hi Visual guibg=Grey30") +vim.cmd("hi! link Type Structure") +vim.cmd("hi! link @property Structure") +vim.cmd("hi! link @variable.builtin Keyword") +vim.cmd("hi! link @constructor @tag") +vim.cmd("hi! LspInlayHint guifg=#aaaa00 guibg=#4d4d4d") +vim.cmd("hi! Statement guifg=#cd7832 gui=italic") +--CursorLine xxx cterm=underline guibg=Grey40 + ----vim.cmd('let g:vim_markdown_conceal = 1') ----vim.cmd('let g:vim_markdown_conceal_code_blocks = 1') -- -----vim.cmd('colorscheme dracula') -require('github-theme').setup({ - options = { - -- Compiled file's destination location - compile_path = vim.fn.stdpath('cache') .. '/github-theme', - compile_file_suffix = '_compiled', -- Compiled file suffix - hide_end_of_buffer = true, -- Hide the '~' character at the end of the buffer for a cleaner look - hide_nc_statusline = true, -- Override the underline style for non-active statuslines - transparent = false, -- Disable setting background - terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal` - dim_inactive = false, -- Non focused panes set to alternative background - module_default = true, -- Default enable value for modules - styles = { -- Style to be applied to different syntax groups - comments = 'NONE', -- Value is any valid attr-list value `:help attr-list` - functions = 'NONE', - keywords = 'NONE', - variables = 'NONE', - conditionals = 'NONE', - constants = 'NONE', - numbers = 'NONE', - operators = 'NONE', - strings = 'NONE', - types = 'NONE', - }, - inverse = { -- Inverse highlight for different types - match_paren = false, - visual = false, - search = false, - }, - darken = { -- Darken floating windows and sidebar-like windows - floats = false, - sidebars = { - enabled = true, - list = {}, -- Apply dark background to specific windows - }, - }, - modules = { -- List of various plugins and additional options - -- ... - }, - }, - palettes = {}, - specs = {}, - groups = {}, -}) +--vim.cmd('colorscheme dracula') +--require("github-theme").setup({ +-- options = { +-- -- Compiled file's destination location +-- compile_path = vim.fn.stdpath("cache") .. "/github-theme", +-- compile_file_suffix = "_compiled", -- Compiled file suffix +-- hide_end_of_buffer = true, -- Hide the '~' character at the end of the buffer for a cleaner look +-- hide_nc_statusline = true, -- Override the underline style for non-active statuslines +-- transparent = false, -- Disable setting background +-- terminal_colors = true, -- Set terminal colors (vim.g.terminal_color_*) used in `:terminal` +-- dim_inactive = false, -- Non focused panes set to alternative background +-- module_default = true, -- Default enable value for modules +-- styles = { -- Style to be applied to different syntax groups +-- comments = "NONE", -- Value is any valid attr-list value `:help attr-list` +-- functions = "NONE", +-- keywords = "NONE", +-- variables = "NONE", +-- conditionals = "NONE", +-- constants = "NONE", +-- numbers = "NONE", +-- operators = "NONE", +-- strings = "NONE", +-- types = "NONE", +-- }, +-- inverse = { -- Inverse highlight for different types +-- match_paren = false, +-- visual = false, +-- search = false, +-- }, +-- darken = { -- Darken floating windows and sidebar-like windows +-- floats = false, +-- sidebars = { +-- enabled = true, +-- list = {}, -- Apply dark background to specific windows +-- }, +-- }, +-- modules = { -- List of various plugins and additional options +-- -- ... +-- }, +-- }, +-- palettes = {}, +-- specs = {}, +-- groups = {}, +--}) -- setup must be called before loading ---vim.cmd('colorscheme github_dark') +--vim.cmd("colorscheme github_dark") -- setup must be called before loading -vim.cmd('colorscheme github_dark') -local soft_tab_2 = function() vim.cmd('set tabstop=2 shiftwidth=2 expandtab') end +--vim.cmd('colorscheme github_dark_colorblind') +vim.api.nvim_set_hl(0, "Normal", { bg = "none" }) +vim.api.nvim_set_hl(0, "NormalFloat", { bg = "none" }) +vim.api.nvim_set_hl(0, "NormalNC", { bg = "none" }) +--vim.cmd('hi NormalNC guifg=#ced1d4 guibg=#232324') + +local soft_tab_2 = function() + vim.cmd("set tabstop=2 shiftwidth=2 expandtab") +end +local hard_tab_3 = function() + vim.cmd("set tabstop=3 shiftwidth=3 noexpandtab") +end + +--vim.opt.spelllang = 'en_us' +--vim.opt.spell = true -vim.api.nvim_create_autocmd({ 'BufEnter', 'BufAdd', 'BufNew', 'BufNewFile', 'BufWinEnter' }, { - pattern = { - "*.dart", - "*.go", - "*.ts", - --"*.lua", - }, - callback = soft_tab_2 +vim.api.nvim_create_autocmd({ "BufEnter", "BufAdd", "BufNew", "BufNewFile", "BufWinEnter" }, { + pattern = { + "*.dart", + "*.go", + --"*.ts", + --"*.lua", + }, + callback = soft_tab_2, }) +vim.api.nvim_create_autocmd({ "BufEnter", "BufAdd", "BufNew", "BufNewFile", "BufWinEnter" }, { + pattern = { + "*.ts", + "*.lua", + }, + callback = hard_tab_3, +}) --augroup markdown_language_client_commands -- autocmd! -- autocmd WinLeave __LanguageClient__ ++nested call fixLanguageClientHover() diff --git a/lua/user/plugins_with_packer.lua b/lua/user/plugins_with_packer.lua index 27f7c78..e72fa98 100644 --- a/lua/user/plugins_with_packer.lua +++ b/lua/user/plugins_with_packer.lua @@ -1,319 +1,319 @@ -local fn = vim.fn -local noice_config = require 'user.configs.noice-config' -local notify_config = require 'user.configs.notify-config' -local neo_tree_config = require 'user.configs.neo-tree' -local nivm_window_picker = require 'user.configs.nvim-window-picker' - --- Automatically install packer -local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" -if fn.empty(fn.glob(install_path)) > 0 then - PACKER_BOOTSTRAP = fn.system { - "git", - "clone", - "--depth", - "1", - "https://github.com/wbthomason/packer.nvim", - install_path, - } - print "Installing packer close and reopen Neovim..." - vim.cmd [[packadd packer.nvim]] -end - --- Autocommand that reloads neovim whenever you save the plugins.lua file -vim.cmd [[ - augroup packer_user_config - autocmd! - autocmd BufWritePost plugins.lua source | PackerSync - augroup end -]] - --- Use a protected call so we don't error out on first use -local status_ok, packer = pcall(require, "packer") -if not status_ok then - return -end - --- Have packer use a popup window -packer.init { - git = { - cmd = 'git', -- The base command for git operations - subcommands = { - -- Format strings for git subcommands - update = 'pull --ff-only --progress --rebase=false', - install = 'clone --depth %i --no-single-branch --progress', - fetch = 'fetch --depth 999999 --progress', - checkout = 'checkout %s --', - update_branch = 'merge --ff-only @{u}', - current_branch = 'branch --show-current', - diff = 'log --color=never --pretty=format:FMT --no-show-signature HEAD@{1}...HEAD', - diff_fmt = '%%h %%s (%%cr)', - get_rev = 'rev-parse --short HEAD', - get_msg = 'log --color=never --pretty=format:FMT --no-show-signature HEAD -n 1', - submodules = 'submodule update --init --recursive --progress' - }, - depth = 1, -- Git clone depth - clone_timeout = 600, -- Timeout, in seconds, for git clones - default_url_format = 'https://github.com/%s' -- Lua format string used for "aaa/bbb" style plugins - }, - display = { - open_fn = function() - return require("packer.util").float { border = "rounded" } - end, - }, -} - --- Only required if you have packer configured as `opt` -vim.cmd("packadd packer.nvim") - --- Install your plugins here -return packer.startup(function(use) - use 'wbthomason/packer.nvim' - - -- UI - --use { - -- 'kyazdani42/nvim-tree.lua', - -- requires = { - -- 'kyazdani42/nvim-web-devicons', -- optional, for file icons - -- }, - -- tag = 'nightly' -- optional, updated every week. (see issue #1193) - --} - use { - "nvim-neo-tree/neo-tree.nvim", - branch = "v2.x", - requires = { - "nvim-lua/plenary.nvim", - "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - "MunifTanjim/nui.nvim", - { - -- only needed if you want to use the commands with "_with_window_picker" suffix - 's1n7ax/nvim-window-picker', - tag = "v1.*", - config = nivm_window_picker, - } - }, - config = neo_tree_config - } - --use { - -- "nvim-neo-tree/neo-tree.nvim", - -- branch = "v2.x", - -- requires = { - -- "nvim-lua/plenary.nvim", - -- "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended - -- "MunifTanjim/nui.nvim", - -- } - --} - - use { - 'nvim-telescope/telescope.nvim', tag = '0.1.2', - -- or , branch = '0.1.x', - requires = { - { 'nvim-lua/plenary.nvim', }, - { "nvim-telescope/telescope-live-grep-args.nvim" }, - } - } - - --use "telescope-file-browser.nvim" - - ---- gh github-cli - --use { - -- 'ldelossa/gh.nvim', - -- requires = { { 'ldelossa/litee.nvim' } } - --} - - --use { - -- 'harrisoncramer/gitlab.nvim', - -- requires = { - -- "MunifTanjim/nui.nvim", - -- "nvim-lua/plenary.nvim" - -- }, - -- run = function() require("gitlab").build() end, - -- config = function() - -- require("gitlab").setup() - -- end, - --} - - --use "lukas-reineke/indent-blankline.nvim" - --use "nvimdev/indentmini.nvim" - - -- Bars ... - use { - 'nvim-lualine/lualine.nvim', - requires = { 'kyazdani42/nvim-web-devicons', opt = true } - } - --Checking if make faulty noice - --use 'fgheng/winbar.nvim' - --use { - -- "SmiteshP/nvim-navic", - -- requires = "neovim/nvim-lspconfig" - --} - use 'Bekaboo/dropbar.nvim' - use 'ThePrimeagen/harpoon' - - -- Theme & Stuff - --use 'Rigellute/shades-of-purple.vim' - use "rktjmp/lush.nvim" - use { - "briones-gabriel/darcula-solid.nvim", - requires = "rktjmp/lush.nvim" - } - use({ 'projekt0n/github-nvim-theme' }) - use { "catppuccin/nvim", as = "catppuccin" } - use 'marko-cerovac/material.nvim' - use 'Shatur/neovim-ayu' - - --use { - -- "folke/zen-mode.nvim", - --} - --use 'Mofiqul/dracula.nvim' - - use { - 'nvim-treesitter/nvim-treesitter', - run = ':TSUpdate', - config = function() - require('nvim-treesitter.configs').setup({ - ensure_installed = { "lua" }, - sync_install = true, - auto_install = true, - }) - end, - - } - use 'nvim-treesitter/playground' - use 'brenoprata10/nvim-highlight-colors' - -- not use 'norcalli/nvim-colorizer.lua' - --use{ 'anuvyklack/pretty-fold.nvim', - -- config = function() - -- require('pretty-fold').setup() - -- end - --} - - -- LSP Configurations - --use 'williamboman/nvim-lsp-installer' - use { - "williamboman/mason.nvim", - "williamboman/mason-lspconfig.nvim", - "neovim/nvim-lspconfig", - run = ":MasonUpdate" -- :MasonUpdate updates registry contents - } - use { - 'jay-babu/mason-null-ls.nvim', - requires = { - 'williamboman/mason.nvim', - 'jose-elias-alvarez/null-ls.nvim', - }, - --config = function() - -- require("nx").setup {} - --end - } - --use { 'neovim/nvim-lspconfig', -- Configurations for Nvim LSP - -- --after = "nvim-lsp-installer", - --} - use 'tamago324/nlsp-settings.nvim' - --use "ray-x/lsp_signature.nvim"-- Function signiture - use { 'akinsho/flutter-tools.nvim', requires = 'nvim-lua/plenary.nvim' } - use 'onsails/lspkind.nvim' - --use 'jose-elias-alvarez/null-ls.nvim' - --use 'MunifTanjim/eslint.nvim' - use 'simrat39/symbols-outline.nvim' - use 'f-person/git-blame.nvim' - use { - 'lewis6991/gitsigns.nvim', - -- tag = 'release' -- To use the latest release (do not use this if you run Neovim nightly or dev builds!) - } - use { - 'Equilibris/nx.nvim', - requires = { - 'nvim-telescope/telescope.nvim', - }, - --config = function() - -- require("nx").setup {} - --end - } - --use { - -- "SmiteshP/nvim-navbuddy", - -- - -- requires = { - -- "neovim/nvim-lspconfig", - -- "SmiteshP/nvim-navic", - -- "MunifTanjim/nui.nvim" - -- } - --} - --use "lvimuser/lsp-inlayhints.nvim" - - -- Debugger - use 'mfussenegger/nvim-dap' - use { - "rcarriga/nvim-dap-ui", - requires = { - "mfussenegger/nvim-dap" - } - } - use 'theHamsta/nvim-dap-virtual-text' - use 'rcarriga/cmp-dap' - use 'leoluz/nvim-dap-go' - use 'LiadOz/nvim-dap-repl-highlights' - - use { - "microsoft/vscode-js-debug", - opt = true, - run = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out" - } - - use { - -- used to dap-ext-vscode JSON decoder - 'Joakker/lua-json5', - run = './install.sh' - } - -- Recommend - - -- Optional - --replace with noice - --use 'rcarriga/nvim-notify' - - use 'tpope/vim-fugitive' - use { 'sindrets/diffview.nvim', requires = 'nvim-lua/plenary.nvim' } - - -- Autocompletion - use { - 'hrsh7th/nvim-cmp', -- Autocompletion plugin - 'hrsh7th/cmp-buffer', - 'hrsh7th/cmp-path', - 'hrsh7th/cmp-cmdline', - 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp - } - use 'saadparwaiz1/cmp_luasnip' -- Snippets source for nvim-cmp - use 'L3MON4D3/LuaSnip' -- Snippets plugin - - --Colorize ansi output - --use { 'm00qek/baleia.nvim', tag = 'v1.3.0' } - use 'norcalli/nvim-terminal.lua' - - use { 'stevearc/dressing.nvim' } - use({ - "folke/noice.nvim", - event = "VimEnter", - config = noice_config, - requires = { - -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries - "MunifTanjim/nui.nvim", - ({ - "rcarriga/nvim-notify", - config = notify_config, - }), - } - }) - - use "chiedo/vim-case-convert" - - use({ - "iamcco/markdown-preview.nvim", - run = "cd app && npm install", - setup = function() vim.g.mkdp_filetypes = { "markdown" } end, - ft = { "markdown" }, - }) - --Ghost editor for Google - Chrome - -- use({ - -- 'subnut/nvim-ghost.nvim', - -- run = ':call nvim_ghost#installer#install()' - --}) -end) +--local fn = vim.fn +--local noice_config = require 'user.configs.noice-config' +--local notify_config = require 'user.configs.notify-config' +--local neo_tree_config = require 'user.configs.neo-tree' +--local nivm_window_picker = require 'user.configs.nvim-window-picker' +-- +---- Automatically install packer +--local install_path = fn.stdpath "data" .. "/site/pack/packer/start/packer.nvim" +--if fn.empty(fn.glob(install_path)) > 0 then +-- PACKER_BOOTSTRAP = fn.system { +-- "git", +-- "clone", +-- "--depth", +-- "1", +-- "https://github.com/wbthomason/packer.nvim", +-- install_path, +-- } +-- print "Installing packer close and reopen Neovim..." +-- vim.cmd [[packadd packer.nvim]] +--end +-- +---- Autocommand that reloads neovim whenever you save the plugins.lua file +--vim.cmd [[ +-- augroup packer_user_config +-- autocmd! +-- autocmd BufWritePost plugins.lua source | PackerSync +-- augroup end +--]] +-- +---- Use a protected call so we don't error out on first use +--local status_ok, packer = pcall(require, "packer") +--if not status_ok then +-- return +--end +-- +---- Have packer use a popup window +--packer.init { +-- git = { +-- cmd = 'git', -- The base command for git operations +-- subcommands = { +-- -- Format strings for git subcommands +-- update = 'pull --ff-only --progress --rebase=false', +-- install = 'clone --depth %i --no-single-branch --progress', +-- fetch = 'fetch --depth 999999 --progress', +-- checkout = 'checkout %s --', +-- update_branch = 'merge --ff-only @{u}', +-- current_branch = 'branch --show-current', +-- diff = 'log --color=never --pretty=format:FMT --no-show-signature HEAD@{1}...HEAD', +-- diff_fmt = '%%h %%s (%%cr)', +-- get_rev = 'rev-parse --short HEAD', +-- get_msg = 'log --color=never --pretty=format:FMT --no-show-signature HEAD -n 1', +-- submodules = 'submodule update --init --recursive --progress' +-- }, +-- depth = 1, -- Git clone depth +-- clone_timeout = 600, -- Timeout, in seconds, for git clones +-- default_url_format = 'https://github.com/%s' -- Lua format string used for "aaa/bbb" style plugins +-- }, +-- display = { +-- open_fn = function() +-- return require("packer.util").float { border = "rounded" } +-- end, +-- }, +--} +-- +---- Only required if you have packer configured as `opt` +--vim.cmd("packadd packer.nvim") +-- +---- Install your plugins here +--return packer.startup(function(use) +-- use 'wbthomason/packer.nvim' +-- +-- -- UI +-- --use { +-- -- 'kyazdani42/nvim-tree.lua', +-- -- requires = { +-- -- 'kyazdani42/nvim-web-devicons', -- optional, for file icons +-- -- }, +-- -- tag = 'nightly' -- optional, updated every week. (see issue #1193) +-- --} +-- use { +-- "nvim-neo-tree/neo-tree.nvim", +-- branch = "v2.x", +-- requires = { +-- "nvim-lua/plenary.nvim", +-- "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended +-- "MunifTanjim/nui.nvim", +-- { +-- -- only needed if you want to use the commands with "_with_window_picker" suffix +-- 's1n7ax/nvim-window-picker', +-- tag = "v1.*", +-- config = nivm_window_picker, +-- } +-- }, +-- config = neo_tree_config +-- } +-- --use { +-- -- "nvim-neo-tree/neo-tree.nvim", +-- -- branch = "v2.x", +-- -- requires = { +-- -- "nvim-lua/plenary.nvim", +-- -- "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended +-- -- "MunifTanjim/nui.nvim", +-- -- } +-- --} +-- +-- use { +-- 'nvim-telescope/telescope.nvim', tag = '0.1.2', +-- -- or , branch = '0.1.x', +-- requires = { +-- { 'nvim-lua/plenary.nvim', }, +-- { "nvim-telescope/telescope-live-grep-args.nvim" }, +-- } +-- } +-- +-- --use "telescope-file-browser.nvim" +-- +-- ---- gh github-cli +-- --use { +-- -- 'ldelossa/gh.nvim', +-- -- requires = { { 'ldelossa/litee.nvim' } } +-- --} +-- +-- --use { +-- -- 'harrisoncramer/gitlab.nvim', +-- -- requires = { +-- -- "MunifTanjim/nui.nvim", +-- -- "nvim-lua/plenary.nvim" +-- -- }, +-- -- run = function() require("gitlab").build() end, +-- -- config = function() +-- -- require("gitlab").setup() +-- -- end, +-- --} +-- +-- --use "lukas-reineke/indent-blankline.nvim" +-- --use "nvimdev/indentmini.nvim" +-- +-- -- Bars ... +-- use { +-- 'nvim-lualine/lualine.nvim', +-- requires = { 'kyazdani42/nvim-web-devicons', opt = true } +-- } +-- --Checking if make faulty noice +-- --use 'fgheng/winbar.nvim' +-- --use { +-- -- "SmiteshP/nvim-navic", +-- -- requires = "neovim/nvim-lspconfig" +-- --} +-- use 'Bekaboo/dropbar.nvim' +-- use 'ThePrimeagen/harpoon' +-- +-- -- Theme & Stuff +-- --use 'Rigellute/shades-of-purple.vim' +-- use "rktjmp/lush.nvim" +-- use { +-- "briones-gabriel/darcula-solid.nvim", +-- requires = "rktjmp/lush.nvim" +-- } +-- use({ 'projekt0n/github-nvim-theme' }) +-- use { "catppuccin/nvim", as = "catppuccin" } +-- use 'marko-cerovac/material.nvim' +-- use 'Shatur/neovim-ayu' +-- +-- --use { +-- -- "folke/zen-mode.nvim", +-- --} +-- --use 'Mofiqul/dracula.nvim' +-- +-- use { +-- 'nvim-treesitter/nvim-treesitter', +-- run = ':TSUpdate', +-- config = function() +-- require('nvim-treesitter.configs').setup({ +-- ensure_installed = { "lua" }, +-- sync_install = true, +-- auto_install = true, +-- }) +-- end, +-- +-- } +-- use 'nvim-treesitter/playground' +-- use 'brenoprata10/nvim-highlight-colors' +-- -- not use 'norcalli/nvim-colorizer.lua' +-- --use{ 'anuvyklack/pretty-fold.nvim', +-- -- config = function() +-- -- require('pretty-fold').setup() +-- -- end +-- --} +-- +-- -- LSP Configurations +-- --use 'williamboman/nvim-lsp-installer' +-- use { +-- "williamboman/mason.nvim", +-- "williamboman/mason-lspconfig.nvim", +-- "neovim/nvim-lspconfig", +-- run = ":MasonUpdate" -- :MasonUpdate updates registry contents +-- } +-- use { +-- 'jay-babu/mason-null-ls.nvim', +-- requires = { +-- 'williamboman/mason.nvim', +-- 'jose-elias-alvarez/null-ls.nvim', +-- }, +-- --config = function() +-- -- require("nx").setup {} +-- --end +-- } +-- --use { 'neovim/nvim-lspconfig', -- Configurations for Nvim LSP +-- -- --after = "nvim-lsp-installer", +-- --} +-- use 'tamago324/nlsp-settings.nvim' +-- --use "ray-x/lsp_signature.nvim"-- Function signiture +-- use { 'akinsho/flutter-tools.nvim', requires = 'nvim-lua/plenary.nvim' } +-- use 'onsails/lspkind.nvim' +-- --use 'jose-elias-alvarez/null-ls.nvim' +-- --use 'MunifTanjim/eslint.nvim' +-- use 'simrat39/symbols-outline.nvim' +-- use 'f-person/git-blame.nvim' +-- use { +-- 'lewis6991/gitsigns.nvim', +-- -- tag = 'release' -- To use the latest release (do not use this if you run Neovim nightly or dev builds!) +-- } +-- use { +-- 'Equilibris/nx.nvim', +-- requires = { +-- 'nvim-telescope/telescope.nvim', +-- }, +-- --config = function() +-- -- require("nx").setup {} +-- --end +-- } +-- --use { +-- -- "SmiteshP/nvim-navbuddy", +-- -- +-- -- requires = { +-- -- "neovim/nvim-lspconfig", +-- -- "SmiteshP/nvim-navic", +-- -- "MunifTanjim/nui.nvim" +-- -- } +-- --} +-- --use "lvimuser/lsp-inlayhints.nvim" +-- +-- -- Debugger +-- use 'mfussenegger/nvim-dap' +-- use { +-- "rcarriga/nvim-dap-ui", +-- requires = { +-- "mfussenegger/nvim-dap" +-- } +-- } +-- use 'theHamsta/nvim-dap-virtual-text' +-- use 'rcarriga/cmp-dap' +-- use 'leoluz/nvim-dap-go' +-- use 'LiadOz/nvim-dap-repl-highlights' +-- +-- use { +-- "microsoft/vscode-js-debug", +-- opt = true, +-- run = "npm install --legacy-peer-deps && npx gulp vsDebugServerBundle && mv dist out" +-- } +-- +-- use { +-- -- used to dap-ext-vscode JSON decoder +-- 'Joakker/lua-json5', +-- run = './install.sh' +-- } +-- -- Recommend +-- +-- -- Optional +-- --replace with noice +-- --use 'rcarriga/nvim-notify' +-- +-- use 'tpope/vim-fugitive' +-- use { 'sindrets/diffview.nvim', requires = 'nvim-lua/plenary.nvim' } +-- +-- -- Autocompletion +-- use { +-- 'hrsh7th/nvim-cmp', -- Autocompletion plugin +-- 'hrsh7th/cmp-buffer', +-- 'hrsh7th/cmp-path', +-- 'hrsh7th/cmp-cmdline', +-- 'hrsh7th/cmp-nvim-lsp' -- LSP source for nvim-cmp +-- } +-- use 'saadparwaiz1/cmp_luasnip' -- Snippets source for nvim-cmp +-- use 'L3MON4D3/LuaSnip' -- Snippets plugin +-- +-- --Colorize ansi output +-- --use { 'm00qek/baleia.nvim', tag = 'v1.3.0' } +-- use 'norcalli/nvim-terminal.lua' +-- +-- use { 'stevearc/dressing.nvim' } +-- use({ +-- "folke/noice.nvim", +-- event = "VimEnter", +-- config = noice_config, +-- requires = { +-- -- if you lazy-load any plugin below, make sure to add proper `module="..."` entries +-- "MunifTanjim/nui.nvim", +-- ({ +-- "rcarriga/nvim-notify", +-- config = notify_config, +-- }), +-- } +-- }) +-- +-- use "chiedo/vim-case-convert" +-- +-- use({ +-- "iamcco/markdown-preview.nvim", +-- run = "cd app && npm install", +-- setup = function() vim.g.mkdp_filetypes = { "markdown" } end, +-- ft = { "markdown" }, +-- }) +-- --Ghost editor for Google - Chrome +-- -- use({ +-- -- 'subnut/nvim-ghost.nvim', +-- -- run = ':call nvim_ghost#installer#install()' +-- --}) +--end) diff --git a/lua/user/setups.lua b/lua/user/setups.lua index c2509b4..33fc718 100644 --- a/lua/user/setups.lua +++ b/lua/user/setups.lua @@ -1,29 +1,32 @@ -require 'user.setups.diffview'; -require 'user.setups.nvim-web-devicons'; -require 'user.setups.tree-sitter'; -require 'user.setups.lua-line'; -require 'user.setups.telescope'; -require 'user.setups.symbol-outline'; +require("user.setups.diffview") +require("user.setups.nvim-web-devicons") +require("user.setups.tree-sitter") +require("user.setups.lua-line") +require("user.setups.telescope") +require("user.setups.symbol-outline") --require 'user.setups.indent_blankline'; -require 'user.setups.gitsigns'; -require 'user.setups.git-blame'; -require "user.setups.dropbar-setup"; +require("user.setups.gitsigns") +require("user.setups.git-blame") +--require "user.setups.dropbar-setup"; +require("user.setups.nvim-ufo") +require("user.setups.statuscol-setup") -- --mappings -- ---require 'user.mapping.telescope' -require 'user.mapping.yanki' -require 'user.mapping.global' -require 'user.mapping.neo-tree' -require 'user.mapping.nvim-tree' -require 'user.mapping.harpoon' ---require 'user.mapping.flutter-toole-mapping' -require 'user.mapping.vim-fugitive'; -require 'user.mapping.mapping'; -require 'user.mapping.dropbar-mapping'; -require 'user.mapping.theme'; +--require 'user.mapping.telescope-mapping' +require("user.mapping.yanki") +require("user.mapping.global") +require("user.mapping.neo-tree") +require("user.mapping.nvim-tree") +require("user.mapping.harpoon") +require("flutter-tools").setup({}) -- use defaults +require("user.mapping.flutter-toole-mapping") +require("user.mapping.vim-fugitive") +require("user.mapping.mapping") +--require 'user.mapping.dropbar-mapping'; +require("user.mapping.theme") -require 'user.setups.highlight-colors'; +require("user.setups.highlight-colors") --Problematics --require 'user.setups.nvim-navic'; @@ -31,23 +34,23 @@ require 'user.setups.highlight-colors'; --require 'user.setups.dressing'; --require 'user.setups.navbuddy'; -require "notify".setup( - { - render = "compact", - top_down = false - } -); +require("notify").setup({ + render = "compact", + top_down = false, +}) -require "user.setups.dap"; -require "user.setups.dap-ui"; -require "user.setups.go-dap"; -require "user.setups.dap-virtual-text"; +require("user.setups.dap") +require("user.setups.dap-ui") +require("user.setups.go-dap") +require("user.setups.dap-virtual-text") --require 'user.setups.eslint'; --require 'user.setups.mason'; -require "user.setups.mason-null-ls-setup"; +require("user.setups.mason-null-ls-setup") +require("user.setups.lint") +require("user.setups.inlay-hint-setup") --require('baleia').setup { } -require'terminal'.setup() +require("terminal").setup() --require 'user.setups.gh-nvim-setup'; diff --git a/lua/user/setups/dap.lua b/lua/user/setups/dap.lua index 3cd25c3..6a42d0c 100644 --- a/lua/user/setups/dap.lua +++ b/lua/user/setups/dap.lua @@ -64,46 +64,188 @@ require "user.mapping.dap-mapping" require('dap.ext.vscode').load_launchjs(nil, {}) require('nvim-dap-repl-highlights').setup() -local dap = require'dap' +local dap = require 'dap' dap.defaults.fallback.terminal_win_cmd = '50vsplit new' dap.defaults.fallback.focus_terminal = true vim.api.nvim_create_autocmd("FileType", { - pattern = "dap-repl", - command = "setl ft=terminal" + pattern = "dap-repl", + command = "setl ft=terminal" }) -require("dap-vscode-js").setup({ - -- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node" - -- debugger_path = "(runtimedir)/site/pack/packer/opt/vscode-js-debug", -- Path to vscode-js-debug installation. - -- debugger_cmd = { "js-debug-adapter" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`. - adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' }, -- which adapters to register in nvim-dap - -- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging - -- log_file_level = false -- Logging level for output to file. Set to false to disable file logging. - -- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output. -}) - -for _, language in ipairs({ "typescript", "javascript" }) do - require("dap").configurations[language] = { - ... -- see below - } -end -local terminal = require'terminal' - ---vim.api.nvim_create_autocmd("FileType", { --- pattern = "dap-repl", --- callback = function(ev) --- print(string.format('event fired: %s', vim.inspect(ev))) --- print(string.format('event fired: %s', vim.inspect(ev.buf))) --- terminal.attach_to_buffer(ev.buff) --- end +--require('dap-vscode-js').setup({ +-- node_path = 'node', +-- debugger_path = '/home/nima/Applications/jsDebug/vscode-js-debug', +-- adapters = { 'node', 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' }, --}) +----require("dap-vscode-js").setup({ +---- -- node_path = "node", -- Path of node executable. Defaults to $NODE_PATH, and then "node" +---- -- debugger_path = "(runtimedir)/site/pack/packer/opt/vscode-js-debug", -- Path to vscode-js-debug installation. +---- -- debugger_cmd = { "js-debug-adapter" }, -- Command to use to launch the debug server. Takes precedence over `node_path` and `debugger_path`. +---- adapters = { 'pwa-node', 'pwa-chrome', 'pwa-msedge', 'node-terminal', 'pwa-extensionHost' }, -- which adapters to register in nvim-dap +---- -- log_file_path = "(stdpath cache)/dap_vscode_js.log" -- Path for file logging +---- -- log_file_level = false -- Logging level for output to file. Set to false to disable file logging. +---- -- log_console_level = vim.log.levels.ERROR -- Logging level for output to console. Set to false to disable console output. +----}) -- ---vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { --- pattern = "*.dap-repl", --- --command = "setl ft=terminal" --- callback = function(ev) --- print(string.format('event fired: s', vim.inspect(ev))) --- terminal.attach_to_buffer(ev.buff) --- end ---}) +----require("dap").adapters["node"] = { +---- type = "server", +---- host = "localhost", +---- port = "${port}", +---- executable = { +---- command = "node", +---- -- 💀 Make sure to update this path to point to your installation +---- args = { "/home/nima/Applications/jsDebug/js-debug/src/dapDebugServer.js", "${port}" }, +---- } +----} +-- +--for _, language in ipairs({ "typescript", "javascript" }) do +-- dap.configurations[language] = { +-- { +-- type = 'pwa-node', +-- request = 'launch', +-- name = 'Launch Current File (pwa-node with ts-node)', +-- cwd = vim.fn.getcwd(), +-- runtimeArgs = { '--loader', 'ts-node/esm' }, +-- runtimeExecutable = 'node', +-- args = { '${file}' }, +-- sourceMaps = true, +-- protocol = 'inspector', +-- skipFiles = { '/**', 'node_modules/**' }, +-- resolveSourceMapLocations = { +-- "${workspaceFolder}/**", +-- "!**/node_modules/**", +-- }, +-- }, +-- { +-- type = "pwa-node", +-- request = "launch", +-- name = "Launch file", +-- program = "${file}", +-- cwd = "${workspaceFolder}", +-- }, +-- { +-- type = "node", +-- request = "launch", +-- name = "Launch Program node", +-- skipFiles = { +-- "/**", "src/**/*.spec.ts" +-- }, +-- program = "${workspaceFolder}/src/main.ts", +-- preLaunchTask = "tsc: build - tsconfig.json", +-- outFiles = { +-- "${workspaceFolder}/dist/**/*.js" +-- } +-- }, +-- --{ +-- -- type = "pwa-node", +-- -- request = "launch", +-- -- name = "Launch file", +-- -- program = "${file}", +-- -- cwd = "${workspaceFolder}", +-- --}, +-- { +-- type = "pwa-node", +-- request = "attach", +-- name = "Attach", +-- processId = require 'dap.utils'.pick_process, +-- cwd = "${workspaceFolder}", +-- } +-- } +--end +----local terminal = require 'terminal' +-- +----vim.api.nvim_create_autocmd("FileType", { +---- pattern = "dap-repl", +---- callback = function(ev) +---- print(string.format('event fired: %s', vim.inspect(ev))) +---- print(string.format('event fired: %s', vim.inspect(ev.buf))) +---- terminal.attach_to_buffer(ev.buff) +---- end +----}) +---- +----vim.api.nvim_create_autocmd({ "BufEnter", "BufWinEnter" }, { +---- pattern = "*.dap-repl", +---- --command = "setl ft=terminal" +---- callback = function(ev) +---- print(string.format('event fired: s', vim.inspect(ev))) +---- terminal.attach_to_buffer(ev.buff) +---- end +----}) +--- +--- + +local js_based_languages = { + "typescript", + "javascript", + "typescriptreact", + "javascriptreact", + "vue", +} + +for _, language in ipairs(js_based_languages) do + dap.configurations[language] = { + -- Debug single nodejs files + { + type = "pwa-node", + request = "launch", + name = "Launch file", + program = "${file}", + cwd = vim.fn.getcwd(), + sourceMaps = true, + }, + -- Debug nodejs processes (make sure to add --inspect when you run the process) + { + type = "pwa-node", + request = "attach", + name = "Attach", + processId = require("dap.utils").pick_process, + cwd = vim.fn.getcwd(), + sourceMaps = true, + }, + -- Debug web applications (client side) + { + type = "pwa-chrome", + request = "launch", + name = "Launch & Debug Chrome", + url = function() + local co = coroutine.running() + return coroutine.create(function() + vim.ui.input({ + prompt = "Enter URL: ", + default = "http://localhost:3000", + }, function(url) + if url == nil or url == "" then + return + else + coroutine.resume(co, url) + end + end) + end) + end, + webRoot = vim.fn.getcwd(), + protocol = "inspector", + sourceMaps = true, + userDataDir = false, + }, + { + type = "node", + request = "launch", + name = "Launch Program node", + skipFiles = { + "/**", "src/**/*.spec.ts" + }, + program = "${workspaceFolder}/src/main.ts", + preLaunchTask = "tsc: build - tsconfig.json", + outFiles = { + "${workspaceFolder}/dist/**/*.js" + } + }, + -- Divider for the launch.json derived configs + { + name = "----- ↓ launch.json configs ↓ -----", + type = "", + request = "launch", + }, + } +end diff --git a/lua/user/setups/diffview.lua b/lua/user/setups/diffview.lua index 3fbac37..264e5cd 100644 --- a/lua/user/setups/diffview.lua +++ b/lua/user/setups/diffview.lua @@ -1,6 +1,6 @@ local actions = require("diffview.actions") -require("diffview").setup({ +require'diffview'.setup({ diff_binaries = false, -- Show diffs for binaries enhanced_diff_hl = false, -- See ':h diffview-config-enhanced_diff_hl' git_cmd = { "git" }, -- The git executable followed by default args. diff --git a/lua/user/setups/dropbar-setup.lua b/lua/user/setups/dropbar-setup.lua index 25e4551..ba3c8d7 100644 --- a/lua/user/setups/dropbar-setup.lua +++ b/lua/user/setups/dropbar-setup.lua @@ -1,2 +1,2 @@ -local opts = require "user.configs.dropbar-cfg" -require('dropbar').setup(opts) +--local opts = require "user.configs.dropbar-cfg" +--require('dropbar').setup(opts) diff --git a/lua/user/setups/gitsigns.lua b/lua/user/setups/gitsigns.lua index 1743e7d..d51a0c5 100644 --- a/lua/user/setups/gitsigns.lua +++ b/lua/user/setups/gitsigns.lua @@ -1,41 +1,57 @@ -require('gitsigns').setup { - signs = { - add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, - change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, - delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, - topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, - changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, - }, - signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` - numhl = false, -- Toggle with `:Gitsigns toggle_numhl` - linehl = false, -- Toggle with `:Gitsigns toggle_linehl` - word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` - watch_gitdir = { - interval = 1000, - follow_files = true - }, - attach_to_untracked = true, - current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` - current_line_blame_opts = { - virt_text = true, - virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align' - delay = 1000, - ignore_whitespace = false, - }, - current_line_blame_formatter = ', - ', - sign_priority = 6, - update_debounce = 100, - status_formatter = nil, -- Use default - max_file_length = 40000, -- Disable if file is longer than this (in lines) - preview_config = { - -- Options passed to nvim_open_win - border = 'single', - style = 'minimal', - relative = 'cursor', - row = 0, - col = 1 - }, - yadm = { - enable = false - }, -} +require("gitsigns").setup({ + signs = { + add = { text = "┃" }, + change = { text = "┃" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + untracked = { text = "┆" }, + }, + signs_staged = { + add = { text = "┃" }, + change = { text = "┃" }, + delete = { text = "_" }, + topdelete = { text = "‾" }, + changedelete = { text = "~" }, + untracked = { text = "┆" }, + }, + --signs = { + -- add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'}, + -- change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + -- delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + -- topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'}, + -- changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'}, + --}, + signcolumn = true, -- Toggle with `:Gitsigns toggle_signs` + numhl = false, -- Toggle with `:Gitsigns toggle_numhl` + linehl = false, -- Toggle with `:Gitsigns toggle_linehl` + word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff` + watch_gitdir = { + interval = 1000, + follow_files = true, + }, + attach_to_untracked = true, + current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame` + current_line_blame_opts = { + virt_text = true, + virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align' + delay = 1000, + ignore_whitespace = false, + }, + current_line_blame_formatter = ", - ", + sign_priority = 6, + update_debounce = 100, + status_formatter = nil, -- Use default + max_file_length = 40000, -- Disable if file is longer than this (in lines) + preview_config = { + -- Options passed to nvim_open_win + border = "single", + style = "minimal", + relative = "cursor", + row = 0, + col = 1, + }, + yadm = { + enable = false, + }, +}) diff --git a/lua/user/setups/inlay-hint-setup.lua b/lua/user/setups/inlay-hint-setup.lua new file mode 100644 index 0000000..8932deb --- /dev/null +++ b/lua/user/setups/inlay-hint-setup.lua @@ -0,0 +1,4 @@ +require("inlay-hints").setup({ + commands = { enable = true }, -- Enable InlayHints commands, include `InlayHintsToggle`, `InlayHintsEnable` and `InlayHintsDisable` + autocmd = { enable = true }, -- Enable the inlay hints on `LspAttach` event +}) diff --git a/lua/user/setups/lint.lua b/lua/user/setups/lint.lua new file mode 100644 index 0000000..65a7c1e --- /dev/null +++ b/lua/user/setups/lint.lua @@ -0,0 +1,75 @@ +local conform = require("conform") +conform.setup({ + formatters_by_ft = { + javascript = { "prettier" }, + typescript = { "prettier" }, + javascriptreact = { "prettier" }, + typescriptreact = { "prettier" }, + --svelte = { 'prettier' }, + css = { "prettier" }, + html = { "prettier" }, + json = { "prettier" }, + yaml = { "prettier" }, + markdown = { "prettier" }, + --graphql = { 'prettier' }, + --liquid = { 'prettier' }, + lua = { "stylua" }, + --python = { 'isort', 'black' }, + --c = { 'clang-format' }, + --cpp = { 'clang-format' }, + --c_sharp = { 'csharpier' }, + go = { "gofmt" }, + --rust = { 'rustfmt' }, + --php = { 'pretty-php' }, + }, + format_on_save = { + lsp_fallback = true, + async = false, + timeout_ms = 1000, + }, +}) + +require("mason-conform").setup() +-- +--local lint = require("lint") +--lint.linters_by_ft = { +-- --c = { 'cpplint' }, +-- --cpp = { 'cpplint' }, +-- javascript = { "eslint_d" }, +-- typescript = { "eslint_d" }, +-- javascriptreact = { "eslint_d" }, +-- typescriptreact = { "eslint_d" }, +-- html = { "htmlhint" }, +-- css = { "stylelint" }, +-- --lua = { "luacheck" }, +-- python = { "ruff" }, +-- go = { "golangci-lint" }, +-- --rust = { 'snyk' }, +-- --php = { 'phpcs' }, +--} +-- +----require('mason-nvim-lint').setup() +--require("mason-nvim-lint").setup({ +-- ensure_installed = { "cspell" }, -- bacon linter for rust is not available in nvim-lint, so it's specified to be directly installed from the mason's registry +-- quiet_mode = false, +--}) +-- +--vim.api.nvim_create_autocmd({ "BufWritePost" }, { +-- callback = function() +-- require("lint").try_lint() +-- require("lint").try_lint("cspell") +-- end, +--}) +-- +----vim.api.nvim_create_autocmd({ "BufWritePost" }, { +---- callback = function() +---- +---- -- try_lint without arguments runs the linters defined in `linters_by_ft` +---- -- for the current filetype +---- require("lint").try_lint() +---- +---- -- You can call `try_lint` with a linter name or a list of names to always +---- -- run specific linters, independent of the `linters_by_ft` configuration +---- require("lint").try_lint("cspell") +---- end, +----}) diff --git a/lua/user/setups/lua-line.lua b/lua/user/setups/lua-line.lua index b97810d..01b7a84 100644 --- a/lua/user/setups/lua-line.lua +++ b/lua/user/setups/lua-line.lua @@ -29,12 +29,15 @@ local colors = { local branch = { 'branch', icon = "", + on_click = function() + vim.cmd('Telescope git_branches') + end, } local filename = { 'filename', on_click = function() - vim.cmd('Nvimtree reveal') + vim.cmd('Neotree reveal') end, } @@ -195,6 +198,7 @@ lualine.setup { --component_separators = { left = '', right = '' }, --section_separators = { left = '', right = '' }, --theme = bubbles_theme, + theme = "auto", component_separators = '|', section_separators = { left = '', right = '' }, disabled_filetypes = { @@ -237,7 +241,9 @@ lualine.setup { lualine_y = { 'filename' }, lualine_z = {} }, - tabline = {}, + --tabline = { + -- lualine_a = { { 'tabs', separator = { left= '', right = ''}, mode = 1 } } + --}, --winbar = { -- lualine_a = {}, -- lualine_b = { { 'filename', separator = { left = '' }, right_padding = 2 }, }, diff --git a/lua/user/setups/mason-null-ls-setup.lua b/lua/user/setups/mason-null-ls-setup.lua index aad14d3..75be387 100644 --- a/lua/user/setups/mason-null-ls-setup.lua +++ b/lua/user/setups/mason-null-ls-setup.lua @@ -1,3 +1,14 @@ +--require("null-ls").setup() +--require("mason-null-ls").setup({ +-- methods = { +-- +-- }, +-- ensure_installed = { "stylua", "cspell", "prettierd", "eslint" }, +-- automatic_setup = true, +-- handlers = {}, +--}) +----local cspell = require('cspell') +----local cspellConfig = require('user.configs.cspell') --require("mason-null-ls").setup({ -- ensure_installed = { -- --'stylua', -- Opt to list sources here, when available in mason. @@ -5,46 +16,59 @@ -- 'cspell', -- --'golangci_lint_ls', -- }, --- automatic_installation = false, --- --{ --- -- --'stylua', -- Opt to list sources here, when available in mason. --- -- --'buf', --- -- 'cspell', --- -- --'golangci_lint_ls', --- -- exclude = {"protolint" } --- --}, +-- automatic_installation = false, --onestall +-- { +-- -- --'stylua', -- Opt to list sources here, when available in mason. +-- -- --'buf', +-- 'cspell', +-- -- --'golangci_lint_ls', +-- -- exclude = {"protolint" } +-- }, -- handlers = {}, --}) ----- ----- ---local null_ls = require("null-ls") ---null_ls.setup({ --- sources = { --- -- -- Anything not supported by mason. --- null_ls.builtins.completion.spell, +------ +------ +----- -- --- -- --CodeActions --- -- null_ls.builtins.code_actions.refactoring, --- -- null_ls.builtins.code_actions.gomodifytags, -- --- -- --Linting --- --null_ls.builtins.diagnostics.golangci_lint, --- null_ls.builtins.diagnostics.eslint, --- null_ls.builtins.code_actions.eslint_d, --- null_ls.builtins.formatting.prettier, --- --- -- --Diag --- -- --null_ls.builtins.diagnostics.revive, --- --- -- --Format --- null_ls.builtins.formatting.gofumpt, --- null_ls.builtins.formatting.goimports, --- null_ls.builtins.formatting.goimports_reviser, --- -- null_ls.builtins.formatting.stylua, --- }, --- --- -- #{m}: message --- -- #{s}: source name (defaults to null-ls if not specified) --- -- #{c}: code (if available) --- diagnostics_format = "#{m} (#{s})", ---}) +local cspell_config = { + find_json = function(cwd) + print("Locating dic " .. cwd .. "/cspell.json") + return cwd .. "/cspell.json" + end, +} +local cspell = require("cspell") + +local null_ls = require("null-ls") +null_ls.setup({ + sources = { + -- -- Anything not suppoarted by masonaaaa. + --null_ls.builtins.completion.spell, + + -- --CodeActions + -- null_ls.builtins.code_actions.refactoring, + -- null_ls.builtins.code_actions.gomodifytags, + + -- --Linting + --null_ls.builtins.diagnostics.golangci_lint, + --null_ls.builtins.diagnostics.eslint, + --null_ls.builtins.code_actions.eslint_d, + --null_ls.builtins.formatting.prettier, + + -- --Diag + -- --null_ls.builtins.diagnostics.revive, + + -- --Format + null_ls.builtins.formatting.gofumpt, + null_ls.builtins.formatting.goimports, + null_ls.builtins.formatting.goimports_reviser, + -- null_ls.builtins.formatting.stylua, + cspell.diagnostics.with({ config = cspell_config }), + cspell.code_actions.with({ config = cspell_config }), + }, + + -- #{m}: message + -- #{s}: source name (defaults to null-ls if not specified) + -- #{c}: code (if available) + diagnostics_format = "#{m} (#{s})", +}) diff --git a/lua/user/setups/mason.lua b/lua/user/setups/mason.lua index 8e28868..d524ee3 100644 --- a/lua/user/setups/mason.lua +++ b/lua/user/setups/mason.lua @@ -1,19 +1,19 @@ -require("mason").setup() -require("mason-lspconfig").setup({ - ensure_installed = { - --'cspells', - --'eslint', - --'golangci_lint_ls', - --'buf', - --'protolint', - --'grammarly', - 'gopls', - 'html', - 'lua_ls', - 'svelte', - 'tailwindcss', - 'tsserver', - 'cssls', - 'jsonls', - }, -}) +--require("mason").setup() +--require("mason-lspconfig").setup({ +-- ensure_installed = { +-- --'cspells', +-- --'eslint', +-- --'golangci_lint_ls', +-- --'buf', +-- --'protolint', +-- --'grammarly', +-- 'gopls', +-- 'html', +-- 'lua_ls', +-- 'svelte', +-- 'tailwindcss', +-- 'tsserver', +-- 'cssls', +-- 'jsonls', +-- }, +--}) diff --git a/lua/user/setups/nvim-ufo.lua b/lua/user/setups/nvim-ufo.lua new file mode 100644 index 0000000..8d34b9e --- /dev/null +++ b/lua/user/setups/nvim-ufo.lua @@ -0,0 +1,38 @@ +vim.o.foldcolumn = "1" -- '0' is not bad +vim.o.foldlevel = 99 -- Using ufo provider need a large value, feel free to decrease the value +vim.o.foldlevelstart = 99 +vim.o.foldenable = true + +-- Using ufo provider need remap `zR` and `zM`. If Neovim is 0.6.1, remap yourself +vim.keymap.set("n", "zR", require("ufo").openAllFolds) +vim.keymap.set("n", "zM", require("ufo").closeAllFolds) + +vim.cmd([[ + +" hi default UfoFoldedFg guifg=Normal.foreground +" hi default UfoFoldedBg guibg=Folded.background +hi default link UfoPreviewSbar PmenuSbar +hi default link UfoPreviewThumb PmenuThumb +hi default link UfoPreviewWinBar UfoFoldedBg +hi default link UfoPreviewCursorLine Visual +hi default link UfoFoldedEllipsis Comment +hi default link UfoCursorFoldedLine CursorLine +]]) + +require("ufo").setup({ + provider_selector = function(bufnr, filetype, buftype) + return { "treesitter", "indent" } + end, + --provider_selector = function(bufnr, filetype, buftype) + -- return '' + --end +}) + +vim.keymap.set("n", "", function() + local winid = require("ufo").peekFoldedLinesUnderCursor() + if not winid then + -- choose one of coc.nvim and nvim lsp + vim.fn.CocActionAsync("definitionHover") -- coc.nvim + vim.lsp.buf.hover() + end +end) diff --git a/lua/user/setups/statuscol-setup.lua b/lua/user/setups/statuscol-setup.lua new file mode 100644 index 0000000..25d15e4 --- /dev/null +++ b/lua/user/setups/statuscol-setup.lua @@ -0,0 +1,15 @@ +local builtin = require("statuscol.builtin") +require("statuscol").setup({ + setopt = true, + -- override the default list of segments with: + -- number-less fold indicator, then signs, then line number & separator + segments = { + { text = { builtin.foldfunc }, click = "v:lua.ScFa" }, + { text = { "%s" }, click = "v:lua.ScSa" }, + { + text = { builtin.lnumfunc, " " }, + condition = { true, builtin.not_empty }, + click = "v:lua.ScLa", + }, + }, +}) diff --git a/lua/user/setups/telescope.lua b/lua/user/setups/telescope.lua index 8a7ad02..1135c0f 100644 --- a/lua/user/setups/telescope.lua +++ b/lua/user/setups/telescope.lua @@ -1,25 +1,42 @@ +local function filenameFirst(_, path) + local tail = vim.fs.basename(path) + local parent = vim.fs.dirname(path) + if parent == "." then return tail end + return string.format("%s\t\t%s", tail, parent) +end + +vim.api.nvim_create_autocmd("FileType", { + pattern = "TelescopeResults", + callback = function(ctx) + vim.api.nvim_buf_call(ctx.buf, function() + vim.fn.matchadd("TelescopeParent", "\t\t.*$") + vim.api.nvim_set_hl(0, "TelescopeParent", { link = "Comment" }) + end) + end, +}) local center_list = require "telescope.themes".get_dropdown({ winblend = 10, - width = 0.5, + width = 0.9, prompt = " ", results_height = 15, previewer = false, }) require('telescope').setup({ defaults = { - file_ignore_patterns = { - ".vscode", - ".git", - "node_modules", - "dist", - "public", - "build", + --file_ignore_patterns = { + -- "./.vscode", + -- "./.git", + -- "./node_modules", + -- "./dist", + -- "./public", + -- "./build", - }, + --}, layout_config = { width = 0.9, height = 0.9, --preview_width = 0.35, + --prompt_position = "top", horizontal = { width = { padding = 0.01, @@ -29,18 +46,52 @@ require('telescope').setup({ preview_height = 0.75, }, }, + vimgrep_arguments = { + "rg", + "--color=never", + "--no-heading", + "--with-filename", + "--line-number", + "--column", + "--smart-case", + "--hidden", + }, + color_devicons = true, + --sorting_strategy = "ascending", + sorting_strategy = "descending", + scroll_strategy = "limit", + --layout_config = { + -- prompt_position = "top", + -- height = 50, + -- width = 180, + --}, --theme = center_list, }, border = false, + pickers = { + current_buffer_fuzzy_find = { + --theme = "dropdown", + }, + git_status = { path_display = filenameFirst, }, + find_files = { path_display = filenameFirst, }, + }, extensions = { file_browser = { }, + fzf = { + fuzzy = true, -- false will only do exact matching + override_generic_sorter = true, -- override the generic sorter + override_file_sorter = true, -- override the file sorter + case_mode = "smart_case", -- or "ignore_case" or "respect_case" + -- the default case_mode is "smart_case" + }, }, }) -require("telescope").load_extension("file_browser") require("telescope").load_extension("live_grep_args") require("telescope").load_extension("notify") +--require("telescope").load_extension("file_browser") +--require('telescope').load_extension('fzf') require 'user.mapping.telescope-mapping'; diff --git a/lua/user/setups/tree-sitter.lua b/lua/user/setups/tree-sitter.lua index da293df..e2d5d51 100644 --- a/lua/user/setups/tree-sitter.lua +++ b/lua/user/setups/tree-sitter.lua @@ -7,32 +7,39 @@ -- end --}) -require'nvim-treesitter.configs'.setup { - highlight = { - enable = true, - -- Setting this to true will run `:h syntax` and tree-sitter at the same time. - -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). - -- Using this option may slow down your editor, and you may see some duplicate highlights. - -- Instead of true it can also be a list of languages - additional_vim_regex_highlighting = true, - }, - playground = { - enable = true, - disable = {}, - updatetime = 25, -- Debounced time for highlighting nodes in the playground from source code - persist_queries = false, -- Whether the query persists across vim sessions - keybindings = { - toggle_query_editor = 'o', - toggle_hl_groups = 'i', - toggle_injected_languages = 't', - toggle_anonymous_nodes = 'a', - toggle_language_display = 'I', - focus_language = 'f', - unfocus_language = 'F', - update = 'R', - goto_node = '', - show_help = '?', - }, - } -} +require("nvim-treesitter.configs").setup({ + -- A list of parser names, or "all" (the five listed parsers should always be installed) + ensure_installed = { "c", "lua", "vim", "vimdoc", "query" }, + -- Install parsers synchronously (only applied to `ensure_installed`) + sync_install = false, + + -- Automatically install missing parsers when entering buffer + -- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally + auto_install = true, + + -- List of parsers to ignore installing (or "all") + ignore_install = {}, + + ---- If you need to change the installation directory of the parsers (see -> Advanced Setup) + -- parser_install_dir = "/some/path/to/store/parsers", -- Remember to run vim.opt.runtimepath:append("/some/path/to/store/parsers")! + highlight = { + enable = true, + -- Setting this to true will run `:h syntax` and tree-sitter at the same time. + -- Set this to `true` if you depend on 'syntax' being enabled (like for indentation). + -- Using this option may slow down your editor, and you may see some duplicate highlights. + -- Instead of true it can also be a list of languages + additional_vim_regex_highlighting = false, + }, + + indent = { + disable = { "yaml" }, + enable = false, + module_path = "nvim-treesitter.indent", + }, + modules = {}, +}) + +vim.opt.foldmethod = "expr" +vim.opt.foldexpr = "nvim_treesitter#foldexpr()" +--set nofoldenable " Disable folding at startup. diff --git a/queries/go/injections.scm b/queries/go/injections.scm new file mode 100644 index 0000000..bf95695 --- /dev/null +++ b/queries/go/injections.scm @@ -0,0 +1,22 @@ +(field_declaration + (raw_string_literal) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#set! injection.include-children) + (#set! injection.language "go") +) +;;( +;; (expression_list +;; (raw_string_literal)) @injection.content +;; (#offset! @injection.content 0 1 0 -1) +;; (#set! injection.include-children) +;; (#set! injection.language "go") +;;) +;; +((raw_string_literal) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#lua-match? @injection.content "^`%c?[select|SELECT|with|WITH]") + (#set! injection.language "sql")) +;;((comment) @injection.content +;; (#offset! @injection.content 0 1 0 -1) +;; (#set! injection.include-children) +;; (#set! injection.language "sql")) diff --git a/queries/go/locals.scm b/queries/go/locals.scm new file mode 100644 index 0000000..588b532 --- /dev/null +++ b/queries/go/locals.scm @@ -0,0 +1 @@ +(field_identifier) @field diff --git a/queries/typescript/injections.scm b/queries/typescript/injections.scm new file mode 100644 index 0000000..9b3b8d9 --- /dev/null +++ b/queries/typescript/injections.scm @@ -0,0 +1,4 @@ +((template_string) @injection.content + (#offset! @injection.content 0 1 0 -1) + (#match? @injection.content "\\cselect.*") + (#set! injection.language "sql")) diff --git a/spell/en.utf-8.add b/spell/en.utf-8.add new file mode 100644 index 0000000..601abe0 --- /dev/null +++ b/spell/en.utf-8.add @@ -0,0 +1,12 @@ +auth +okResponse/! +Req +req +updateSession +_datasource +Usecase +dtos +usecases +usecase +usecase +usecases diff --git a/spell/en.utf-8.add.spl b/spell/en.utf-8.add.spl new file mode 100644 index 0000000000000000000000000000000000000000..0a315af34ea9501f3e579da4928c6d3b0e0f4e74 GIT binary patch literal 198 zcmY+8F%H5o3`PB2iJ6^Kw72NM0un2#T1!+E66$8>2;7+d1O|xY*oj|Wd}{X|ZJL_5 zh}<^kZU}S2fDQ}85s)yWhe22^fXME`97^T5vTNibZ|=+neQ|rJsA}}DDHAyyW8w74 gV_!b7ie$Dr2dFh9Dh~zzQEut~%w#zJnfQon1zc?=Hvj+t literal 0 HcmV?d00001