diff --git a/init.lua b/init.lua index f9260b82..d239aa20 100644 --- a/init.lua +++ b/init.lua @@ -64,6 +64,7 @@ vim.opt.rtp:prepend(lazypath) -- -- You can also configure plugins after the setup call, -- as they will be available in your neovim runtime. + require('lazy').setup({ -- NOTE: First, some plugins that don't require any configuration @@ -78,7 +79,8 @@ require('lazy').setup({ 'SirVer/ultisnips', 'honza/vim-snippets', 'natebosch/dartlang-snippets', - + 'dart-lang/dart-vim-plugin', + 'morhetz/gruvbox', -- NOTE: This is where your plugins related to LSP can be installed. -- The configuration is done below. Search for lspconfig to find it below. { @@ -91,13 +93,12 @@ require('lazy').setup({ -- Useful status updates for LSP -- NOTE: `opts = {}` is the same as calling `require('fidget').setup({})` - { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, + { 'j-hui/fidget.nvim', tag = 'legacy', opts = {} }, -- Additional lua configuration, makes nvim stuff amazing! 'folke/neodev.nvim', }, }, - { -- Autocompletion 'hrsh7th/nvim-cmp', @@ -115,7 +116,7 @@ require('lazy').setup({ }, -- Useful plugin to show you pending keybinds. - { 'folke/which-key.nvim', opts = {} }, + { 'folke/which-key.nvim', opts = {} }, { -- Adds git related signs to the gutter, as well as utilities for managing changes 'lewis6991/gitsigns.nvim', @@ -133,16 +134,16 @@ require('lazy').setup({ -- don't override the built-in and fugitive keymaps local gs = package.loaded.gitsigns - vim.keymap.set({'n', 'v'}, ']c', function() + vim.keymap.set({ 'n', 'v' }, ']c', function() if vim.wo.diff then return ']c' end vim.schedule(function() gs.next_hunk() end) return '' - end, {expr=true, buffer = bufnr, desc = "Jump to next hunk"}) - vim.keymap.set({'n', 'v'}, '[c', function() + end, { expr = true, buffer = bufnr, desc = "Jump to next hunk" }) + vim.keymap.set({ 'n', 'v' }, '[c', function() if vim.wo.diff then return '[c' end vim.schedule(function() gs.prev_hunk() end) return '' - end, {expr=true, buffer = bufnr, desc = "Jump to previous hunk"}) + end, { expr = true, buffer = bufnr, desc = "Jump to previous hunk" }) end, }, }, @@ -213,7 +214,16 @@ require('lazy').setup({ }, build = ':TSUpdate', }, - + { + 'akinsho/flutter-tools.nvim', + lazy = false, + dependencies = { + 'nvim-lua/plenary.nvim', + 'stevearc/dressing.nvim', -- optional for vim.ui.select + }, + config = true, + }, + { 'akinsho/git-conflict.nvim', version = "*", config = true }, -- NOTE: Next Step on Your Neovim Journey: Add/Configure additional "plugins" for kickstart -- These are some example plugins that I've included in the kickstart repository. -- Uncomment any of the lines below to enable them. @@ -229,13 +239,92 @@ require('lazy').setup({ { import = 'custom.plugins' }, }, {}) --- [[ Setting options ]] +local flutterConfig = require("flutter-tools") + +flutterConfig.setup { + ui = { + border = "rounded", + notification_style = 'native' + }, + decorations = { + statusline = { + -- set to true to be able use the 'flutter_tools_decorations.app_version' in your statusline + -- this will show the current version of the flutter app from the pubspec.yaml file + app_version = true, + -- set to true to be able use the 'flutter_tools_decorations.device' in your statusline + -- this will show the currently running device if an application was started with a specific + -- device + device = true, + -- set to true to be able use the 'flutter_tools_decorations.project_config' in your statusline + -- this will show the currently selected project configuration + project_config = true, + } + }, + debugger = { -- integrate with nvim dap + install dart code debugger + enabled = false, + run_via_dap = false, -- use dap instead of a plenary job to run flutter apps + -- if empty dap will not stop on any exceptions, otherwise it will stop on those specified + -- see |:help dap.set_exception_breakpoints()| for more info + exception_breakpoints = {} + }, + root_patterns = { ".git", "pubspec.yaml" }, -- patterns to find the root of your flutter project + fvm = true, -- takes priority over path, uses /.fvm/flutter_sdk if enabled + widget_guides = { + enabled = false, + }, + closing_tags = { + highlight = "Comment", -- highlight for the closing tag + prefix = "//", -- character to use for close tag e.g. > Widget + enabled = true -- set to false to disable + }, + dev_log = { + enabled = true, + notify_errors = false, -- if there is an error whilst running then notify the user + open_cmd = "tabedit", -- command to use to open the log buffer + }, + dev_tools = { + autostart = false, -- autostart devtools server if not detected + auto_open_browser = false, -- Automatically opens devtools in the browser + }, + outline = { + open_cmd = "30vnew", -- command to use to open the outline buffer + auto_open = false -- if true this will open the outline automatically when it is first populated + }, + lsp = { + color = { -- show the derived colours for dart variables + enabled = false, -- whether or not to highlight color variables at all, only supported on flutter >= 2.10 + background = false, -- highlight the background + background_color = nil, -- required, when background is transparent (i.e. background_color = { r = 19, g = 17, b = 24},) + foreground = false, -- highlight the foreground + virtual_text = true, -- show the highlight using virtual text + virtual_text_str = "■", -- the virtual text character to highlight + }, + --- OR you can specify a function to deactivate or change or control how the config is created + capabilities = function(config) + config.specificThingIDontWant = false + return config + end, + -- see the link below for details on each option: + -- https://github.com/dart-lang/sdk/blob/master/pkg/analysis_server/tool/lsp_spec/README.md#client-workspace-configuration + settings = { + showTodos = true, + completeFunctionCalls = true, + renameFilesWithClasses = "prompt", -- "always" + enableSnippets = true, + updateImportsOnRename = true, -- Whether to update imports and other directives when files are renamed. Required for `FlutterRename` command. + } + } +} + +---i [[ Setting options ]] -- See `:help vim.o` -- NOTE: You can change these options as you wish! -- Set highlight on search vim.o.hlsearch = false +vim.o.exrc = true + -- Make line numbers default vim.wo.number = true @@ -291,6 +380,14 @@ vim.api.nvim_create_autocmd('TextYankPost', { pattern = '*', }) +-- Auto format +vim.api.nvim_create_autocmd("BufWritePre", { + buffer = buffer, + callback = function() + vim.lsp.buf.format { async = false } + end +}) + -- [[ Configure Telescope ]] -- See `:help telescope` and `:help telescope.setup()` require('telescope').setup { @@ -319,6 +416,7 @@ vim.keymap.set('n', '/', function() end, { desc = '[/] Fuzzily search in current buffer' }) vim.keymap.set('n', 'gf', require('telescope.builtin').git_files, { desc = 'Search [G]it [F]iles' }) +vim.keymap.set('n', 'gs', require('telescope.builtin').git_status, { desc = 'Search [G]it [S]tatus' }) vim.keymap.set('n', 'sf', require('telescope.builtin').find_files, { desc = '[S]earch [F]iles' }) vim.keymap.set('n', 'sh', require('telescope.builtin').help_tags, { desc = '[S]earch [H]elp' }) vim.keymap.set('n', 'sw', require('telescope.builtin').grep_string, { desc = '[S]earch current [W]ord' }) @@ -326,11 +424,21 @@ vim.keymap.set('n', 'sg', require('telescope.builtin').live_grep, { desc vim.keymap.set('n', 'sd', require('telescope.builtin').diagnostics, { desc = '[S]earch [D]iagnostics' }) vim.keymap.set('n', 'sr', require('telescope.builtin').resume, { desc = '[S]earch [R]esume' }) + +-- [[ Configure Flutter tools]] +vim.keymap.set('n', 'r', require('telescope').extensions.flutter.commands, { desc = 'Open command Flutter' }) +-- fvm flutter pub get && fvm flutter packages pub ru:build_runner build --delete-conflicting-outputs +vim.keymap.set('n', 'br', function() + vim.api.nvim_command("botright split new") + vim.fn.system { 'echo', 'hi' } +end, { desc = 'Flutter get pub and build runner' }) + -- [[ Configure Treesitter ]] -- See `:help nvim-treesitter` require('nvim-treesitter.configs').setup { -- Add languages to be installed here that you want installed for treesitter - ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim' }, + ensure_installed = { 'c', 'cpp', 'go', 'lua', 'python', 'rust', 'tsx', 'javascript', 'typescript', 'vimdoc', 'vim', + 'dart', 'prisma' }, -- Autoinstall languages that are not installed. Defaults to false (but you can change for yourself!) auto_install = false, @@ -358,6 +466,7 @@ require('nvim-treesitter.configs').setup { ['if'] = '@function.inner', ['ac'] = '@class.outer', ['ic'] = '@class.inner', + ['uc'] = '@comment.outer' }, }, move = { @@ -398,12 +507,17 @@ vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next diagnos vim.keymap.set('n', 'e', vim.diagnostic.open_float, { desc = 'Open floating diagnostic message' }) vim.keymap.set('n', 'q', vim.diagnostic.setloclist, { desc = 'Open diagnostics list' }) +-- Neotree +vim.keymap.set('n', 'tt', 'Neotree toggle', { desc = "Neo[T]ree [T]oggle" }) +vim.keymap.set('n', 'tr', 'Neotree reveal', { desc = "Neo[T]ree [R]eveal" }) +vim.keymap.set('n', 'ts', 'Neotree git_status', { desc = "Neo[T]ree git [S]tatus" }) + -- [[ Configure LSP ]] -- This function gets run when an LSP connects to a particular buffer. local on_attach = function(_, bufnr) -- NOTE: Remember that lua is a real programming language, and as such it is possible -- to define small helper and utility functions so you don't have to repeat yourself - -- many times. + -- many time -- -- In this case, we create a function that lets us more easily define mappings specific -- for LSP related items. It sets the mode, buffer and description for us each time. @@ -456,9 +570,9 @@ local servers = { -- gopls = {}, -- pyright = {}, -- rust_analyzer = {}, - -- tsserver = {}, - -- html = { filetypes = { 'html', 'twig', 'hbs'} }, - + tsserver = {}, + prismals = {}, + -- html = { filetypes = { 'html', 'twig', 'hbs'} } lua_ls = { Lua = { workspace = { checkThirdParty = false }, @@ -474,6 +588,70 @@ require('neodev').setup() local capabilities = vim.lsp.protocol.make_client_capabilities() capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities) + +-- Setup language servers. +local lspconfig = require('lspconfig') + +lspconfig.dartls.setup({ + cmd = { "dart", "language-server", "--protocol=lsp" }, + filetypes = { "dart" }, + init_options = { + closingLabels = true, + flutterOutline = true, + onlyAnalyzeProjectsWithOpenFiles = true, + outline = true, + suggestFromUnimportedLibraries = true, + }, + -- root_dir = root_pattern("pubspec.yaml"), + settings = { + dart = { + completeFunctionCalls = true, + showTodos = true, + }, + }, + on_attach = function(client, bufnr) + end, +}) + + +-- Global mappings. +-- See `:help vim.diagnostic.*` for documentation on any of the below functions +vim.keymap.set('n', 'e', vim.diagnostic.open_float) +vim.keymap.set('n', '[d', vim.diagnostic.goto_prev) +vim.keymap.set('n', ']d', vim.diagnostic.goto_next) +vim.keymap.set('n', 'q', vim.diagnostic.setloclist) + +-- Use LspAttach autocommand to only map the following keys +-- after the language server attaches to the current buffer +vim.api.nvim_create_autocmd('LspAttach', { + group = vim.api.nvim_create_augroup('UserLspConfig', {}), + callback = function(ev) + -- Enable completion triggered by + vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc' + + -- Buffer local mappings. + -- See `:help vim.lsp.*` for documentation on any of the below functions + local opts = { buffer = ev.buf } + vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts) + vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts) + vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts) + vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts) + vim.keymap.set('n', '', vim.lsp.buf.signature_help, opts) + vim.keymap.set('n', 'wa', vim.lsp.buf.add_workspace_folder, opts) + vim.keymap.set('n', 'wr', vim.lsp.buf.remove_workspace_folder, opts) + vim.keymap.set('n', 'wl', function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, opts) + vim.keymap.set('n', 'D', vim.lsp.buf.type_definition, opts) + vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) + vim.keymap.set({ 'n', 'v' }, 'ca', vim.lsp.buf.code_action, opts) + vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts) + vim.keymap.set('n', 'f', function() + vim.lsp.buf.format { async = true } + end, opts) + end, +}) + -- Ensure the servers above are installed local mason_lspconfig = require 'mason-lspconfig' @@ -492,6 +670,30 @@ mason_lspconfig.setup_handlers { end } +require("lspconfig").dartls.setup({ + cmd = { "dart", "language-server", "--protocol=lsp" }, + filetypes = { "dart" }, + init_options = { + closingLabels = true, + flutterOutline = true, + onlyAnalyzeProjectsWithOpenFiles = true, + outline = true, + suggestFromUnimportedLibraries = true, + }, + -- root_dir = root_pattern("pubspec.yaml"), + settings = { + dart = { + completeFunctionCalls = true, + showTodos = true, + }, + }, + on_attach = function(client, bufnr) + end, +}) + +require("telescope").load_extension("flutter") + + -- [[ Configure nvim-cmp ]] -- See `:help cmp` local cmp = require 'cmp' @@ -541,4 +743,25 @@ cmp.setup { } -- The line beneath this is called `modeline`. See `:help modeline` --- vim: ts=2 sts=2 sw=2 et +-- vim: ts=2 sts=2 sw=2 etc +require('onedark').setup { + colors = { + bright_orange = "#ff8800", -- define a new color + green = '#00ffaa', -- redefine an existing color + }, + highlights = { + -- ["@keyword"] = { fg = '$green' }, + ["@string"] = { fmt = 'bold,italic', fg = '$orange' }, + ["@function"] = { sp = '$yellow' }, + ["@function.builtin"] = { fg = '#0059ff' }, + ["@parameter"] = { fg = '$cyan' }, + ["@variable.builtin"] = { fg = '#00ffff' }, + ["@type.builtin"] = { fg = '#00ffff' }, + -- ["@constant"] = { fg = '$purple' } + -- ["@constant"] = { fg = '$purple' } + -- ["@constant.builtin"] = { fg = '$purple' } + -- ["@type"] = { fg = '$purple' } + } +} + +require('onedark').load() diff --git a/lua/custom/plugins/autopairs.lua b/lua/custom/plugins/autopairs.lua new file mode 100644 index 00000000..3f3d9789 --- /dev/null +++ b/lua/custom/plugins/autopairs.lua @@ -0,0 +1,17 @@ +-- File: lua/custom/plugins/autopairs.lua + +return { + "windwp/nvim-autopairs", + -- Optional dependency + dependencies = { 'hrsh7th/nvim-cmp' }, + config = function() + require("nvim-autopairs").setup {} + -- If you want to automatically add `(` after selecting a function or method + local cmp_autopairs = require('nvim-autopairs.completion.cmp') + local cmp = require('cmp') + cmp.event:on( + 'confirm_done', + cmp_autopairs.on_confirm_done() + ) + end, +} diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua index d20ace4b..e1087673 100644 --- a/lua/custom/plugins/filetree.lua +++ b/lua/custom/plugins/filetree.lua @@ -9,292 +9,292 @@ return { "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended "MunifTanjim/nui.nvim", { - 's1n7ax/nvim-window-picker', - version = '2.*', - config = function() - require 'window-picker'.setup({ - filter_rules = { - include_current_win = false, - autoselect_one = true, - -- filter using buffer options - bo = { - -- if the file type is one of following, the window will be ignored - filetype = { 'neo-tree', "neo-tree-popup", "notify" }, - -- if the buffer type is one of following, the window will be ignored - buftype = { 'terminal', "quickfix" }, - }, + 's1n7ax/nvim-window-picker', + version = '2.*', + config = function() + require 'window-picker'.setup({ + filter_rules = { + include_current_win = false, + autoselect_one = true, + -- filter using buffer options + bo = { + -- if the file type is one of following, the window will be ignored + filetype = { 'neo-tree', "neo-tree-popup", "notify" }, + -- if the buffer type is one of following, the window will be ignored + buftype = { 'terminal', "quickfix" }, }, + }, }) - end, - }, + end, + }, }, - config = function () + config = function() 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, - enable_normal_mode_for_inputs = false, -- Enable normal mode for input dialogs. - 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 - 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", + popup_border_style = "rounded", + enable_git_status = true, + enable_diagnostics = true, + enable_normal_mode_for_inputs = false, -- Enable normal mode for input dialogs. + 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 + 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 = "", + } + }, + -- If you don't want to use these columns, you can set `enabled = false` for each of them individually + file_size = { + enabled = true, + required_width = 64, -- min width of window required to show this column + }, + type = { + enabled = true, + required_width = 122, -- min width of window required to show this column + }, + last_modified = { + enabled = true, + required_width = 88, -- min width of window required to show this column + }, + created = { + enabled = true, + required_width = 110, -- min width of window required to show this column + }, + symlink_target = { + enabled = false, + }, + }, + -- 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-custom-commands-global` + 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 }, - 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 = "", + ["<2-LeftMouse>"] = "open", + [""] = "open", + [""] = "cancel", -- close preview or floating neo-tree window + ["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" } }, - -- If you don't want to use these columns, you can set `enabled = false` for each of them individually - file_size = { - enabled = true, - required_width = 64, -- min width of window required to show this column + ["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", + ["i"] = "show_file_details", + } + }, + nesting_rules = {}, + filesystem = { + filtered_items = { + visible = true, -- 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" }, - type = { - enabled = true, - required_width = 122, -- min width of window required to show this column + hide_by_pattern = { -- uses glob style patterns + --"*.meta", + --"*/src/*/tsconfig.json", }, - last_modified = { - enabled = true, - required_width = 88, -- min width of window required to show this column + always_show = { -- remains visible even if other settings would normally hide it + --".gitignored", }, - created = { - enabled = true, - required_width = 110, -- min width of window required to show this column + never_show = { -- remains hidden even if visible is toggled to true, this overrides always_show + --".DS_Store", + --"thumbs.db" }, - symlink_target = { - enabled = false, + never_show_by_pattern = { -- uses glob style patterns + --".null-ls_*", }, }, - -- 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-custom-commands-global` - commands = {}, + follow_current_file = { + enabled = true, -- This will find and focus the file in the active buffer every time + -- -- the current file is changed while the tree is open. + leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` + }, + 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 = { - 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", - [""] = "open", - [""] = "cancel", -- close preview or floating neo-tree window - ["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", - ["i"] = "show_file_details", - } - }, - 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 = { - enabled = false, -- This will find and focus the file in the active buffer every time - -- -- the current file is changed while the tree is open. - leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` + [""] = "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", + ["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } }, + ["oc"] = { "order_by_created", nowait = false }, + ["od"] = { "order_by_diagnostics", nowait = false }, + ["og"] = { "order_by_git_status", nowait = false }, + ["om"] = { "order_by_modified", nowait = false }, + ["on"] = { "order_by_name", nowait = false }, + ["os"] = { "order_by_size", nowait = false }, + ["ot"] = { "order_by_type", nowait = false }, }, - 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", - ["o"] = { "show_help", nowait=false, config = { title = "Order by", prefix_key = "o" }}, - ["oc"] = { "order_by_created", nowait = false }, - ["od"] = { "order_by_diagnostics", nowait = false }, - ["og"] = { "order_by_git_status", nowait = false }, - ["om"] = { "order_by_modified", nowait = false }, - ["on"] = { "order_by_name", nowait = false }, - ["os"] = { "order_by_size", nowait = false }, - ["ot"] = { "order_by_type", nowait = false }, - }, - 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", - }, + 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 + commands = {} -- Add a custom command or override a global one using the same function name + }, + buffers = { + follow_current_file = { + enabled = true, -- This will find and focus the file in the active buffer every time + -- -- the current file is changed while the tree is open. + leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` }, - buffers = { - follow_current_file = { - enabled = true, -- This will find and focus the file in the active buffer every time - -- -- the current file is changed while the tree is open. - leave_dirs_open = false, -- `false` closes auto expanded dirs, such as with `:Neotree reveal` - }, - group_empty_dirs = true, -- when true, empty folders will be grouped together - show_unloaded = true, - window = { - mappings = { - ["bd"] = "buffer_delete", - [""] = "navigate_up", - ["."] = "set_root", - ["o"] = { "show_help", nowait=false, config = { title = "Order by", prefix_key = "o" }}, - ["oc"] = { "order_by_created", nowait = false }, - ["od"] = { "order_by_diagnostics", nowait = false }, - ["om"] = { "order_by_modified", nowait = false }, - ["on"] = { "order_by_name", nowait = false }, - ["os"] = { "order_by_size", nowait = false }, - ["ot"] = { "order_by_type", nowait = false }, - } - }, + group_empty_dirs = true, -- when true, empty folders will be grouped together + show_unloaded = true, + window = { + mappings = { + ["bd"] = "buffer_delete", + [""] = "navigate_up", + ["."] = "set_root", + ["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } }, + ["oc"] = { "order_by_created", nowait = false }, + ["od"] = { "order_by_diagnostics", nowait = false }, + ["om"] = { "order_by_modified", nowait = false }, + ["on"] = { "order_by_name", nowait = false }, + ["os"] = { "order_by_size", nowait = false }, + ["ot"] = { "order_by_type", nowait = false }, + } }, - 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", - ["o"] = { "show_help", nowait=false, config = { title = "Order by", prefix_key = "o" }}, - ["oc"] = { "order_by_created", nowait = false }, - ["od"] = { "order_by_diagnostics", nowait = false }, - ["om"] = { "order_by_modified", nowait = false }, - ["on"] = { "order_by_name", nowait = false }, - ["os"] = { "order_by_size", nowait = false }, - ["ot"] = { "order_by_type", nowait = false }, - } + }, + 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", + ["o"] = { "show_help", nowait = false, config = { title = "Order by", prefix_key = "o" } }, + ["oc"] = { "order_by_created", nowait = false }, + ["od"] = { "order_by_diagnostics", nowait = false }, + ["om"] = { "order_by_modified", nowait = false }, + ["on"] = { "order_by_name", nowait = false }, + ["os"] = { "order_by_size", nowait = false }, + ["ot"] = { "order_by_type", nowait = false }, } } + } } end, } diff --git a/lua/custom/plugins/trouble.lua b/lua/custom/plugins/trouble.lua new file mode 100644 index 00000000..2e8e8fd4 --- /dev/null +++ b/lua/custom/plugins/trouble.lua @@ -0,0 +1,9 @@ +return { + "folke/trouble.nvim", + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = { + -- your configuration comes here + -- or leave it empty to use the default settings + -- refer to the configuration section below + }, +}