diff --git a/lua/lsp.lua b/lua/lsp.lua index 0d4fea6..9c4850e 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -1,91 +1,32 @@ -local lsp = require('lsp-zero').preset({}) -local lspconfig = require('lspconfig') local loaded_configs = require('lspconfig.configs') -local conform = require('conform') - -local on_attach = function(_, bufnr) - local opts = { buffer = bufnr, remap = false, } - -- 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) - 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', 'D', vim.lsp.buf.type_definition, opts) - vim.keymap.set('n', 'rn', vim.lsp.buf.rename, opts) - vim.keymap.set('n', 'wl', function() - print(vim.inspect(vim.lsp.buf.list_workspace_folders())) - end, 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) - - vim.keymap.set('n', 'L', ':EslintFixAll') - - vim.keymap.set('n', 'F', function() - conform.format() - end, opts) -end - -local function get_config() - local capabilities = vim.lsp.protocol.make_client_capabilities() - capabilities.textDocument.completion.completionItem.snippetSupport = true - - return { - capabilities = capabilities, - } -end +local lspconfig = require('lspconfig') +local my_config = require('lspconf') local function load_custom_configs() - local config_files = vim.split(vim.fn.globpath(vim.fn.stdpath('config') .. '/lua/lspconf', '*.lua', true), '\n') + local config_files = vim.split(vim.fn.globpath(vim.fn.stdpath('config') .. '/lua/lspconf', '*.lua', true), '\n') - for _, f in ipairs(config_files) do - local name = vim.fn.fnamemodify(f, ':t:r') - require('lspconf.' .. name) - end + for _, f in ipairs(config_files) do + local name = vim.fn.fnamemodify(f, ':t:r') + require('lspconf.' .. name) + end end local function setup_default_configs() - local available_servers = require('mason-lspconfig').get_installed_servers() - local config = get_config() + local available_servers = require('mason-lspconfig').get_installed_servers() + local config = my_config + local excluded = { angularls = true, roslyn = true } - for _, server in pairs(available_servers) do - if not loaded_configs[server] then - lspconfig[server].setup(config) + for _, server in pairs(available_servers) do + if loaded_configs[server] or excluded[server] then + goto continue + end + + lspconfig[server].setup(config) + vim.lsp.config(server, config) + + ::continue:: end - end end load_custom_configs() setup_default_configs() - -lsp.on_attach(on_attach) -lsp.setup() - --- You need to setup `cmp` after lsp-zero -local cmp = require('cmp') -local cmp_action = require('lsp-zero').cmp_action() - -cmp.setup({ - mapping = { - -- `Enter` key to confirm completion - [''] = cmp.mapping.confirm({ select = false }), - - -- Ctrl+Space to trigger completion menu - [''] = cmp.mapping.complete(), - - -- Navigate between snippet placeholder - [''] = cmp_action.luasnip_jump_forward(), - [''] = cmp_action.luasnip_jump_backward(), - } -}) diff --git a/lua/lspconf.lua b/lua/lspconf.lua new file mode 100644 index 0000000..6edd57a --- /dev/null +++ b/lua/lspconf.lua @@ -0,0 +1,44 @@ +local conform = require("conform") + +local on_attach = function(_, bufnr) + local opts = { buffer = bufnr, remap = false } + + -- 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) + 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", "D", vim.lsp.buf.type_definition, opts) + vim.keymap.set("n", "rn", vim.lsp.buf.rename, opts) + vim.keymap.set("n", "wl", function() + print(vim.inspect(vim.lsp.buf.list_workspace_folders())) + end, 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) + + vim.keymap.set("n", "f", function() + conform.format({ bufnr = bufnr }) + end, opts) + + vim.keymap.set("i", "", vim.lsp.completion.get, { desc = "trigger autocompletion" }) +end + +local capabilities = vim.lsp.protocol.make_client_capabilities() +capabilities.textDocument.completion.completionItem.snippetSupport = true + +return { + on_attach = on_attach, + capabilities = capabilities, +} diff --git a/lua/lspconf/angular.lua b/lua/lspconf/angular.lua index 193d635..1015999 100644 --- a/lua/lspconf/angular.lua +++ b/lua/lspconf/angular.lua @@ -1,5 +1,4 @@ local lspconfig = require 'lspconfig' -local configs = require 'lspconfig.configs' -- Angular requires a node_modules directory to probe for @angular/language-service and typescript -- in order to use your projects configured versions. @@ -51,18 +50,20 @@ local cmd = { default_angular_core_version, } -lspconfig.angularls.setup({ +local config = { cmd = cmd, on_new_config = function(new_config,new_root_dir) new_config.cmd = cmd end, on_attach = function() for _, server in ipairs(vim.lsp.get_clients()) do - if server.name == "tsserver" then + if server.name == "ts_ls" then local tsserver = vim.lsp.get_client_by_id(server.id) tsserver.server_capabilities.renameProvider = false end end end -}) +} + +lspconfig.angularls.setup(config) diff --git a/lua/lspconf/csharp.lua b/lua/lspconf/csharp.lua index a47be71..92183d9 100644 --- a/lua/lspconf/csharp.lua +++ b/lua/lspconf/csharp.lua @@ -1,92 +1,16 @@ -local util = require 'lspconfig.util' -local configs = require 'lspconfig.configs' +local my_config = require('lspconf') -configs.omnisharp = { - default_config = { - cmd = { "dotnet", - "C:\\Users\\andre.schaf\\.vscode\\extensions\\ms-dotnettools.csharp-2.13.10-win32-x64\\.roslyn\\Microsoft.CodeAnalysis.LanguageServer.dll" - -- "C:\\dev\\tools\\omni\\OmniSharp.Roslyn.dll" - -- "/path/to/omnisharp/OmniSharp.dll" }, +vim.lsp.config("roslyn", { + on_attach = my_config.on_attach, + capabilities = my_config.capabilities, + settings = { + ["csharp|inlay_hints"] = { + csharp_enable_inlay_hints_for_implicit_object_creation = true, + csharp_enable_inlay_hints_for_implicit_variable_types = true, + }, + ["csharp|code_lens"] = { + + dotnet_enable_references_code_lens = true, + }, }, - - filetypes = { 'cs' }, - root_dir = util.root_pattern('*.sln', '*.csproj', 'omnisharp.json', 'function.json'), - enable_editorconfig_support = true, - - -- If true, MSBuild project system will only load projects for files that - -- were opened in the editor. This setting is useful for big C# codebases - -- and allows for faster initialization of code navigation features only - -- for projects that are relevant to code that is being edited. With this - -- setting enabled OmniSharp may load fewer projects and may thus display - -- incomplete reference lists for symbols. - enable_ms_build_load_projects_on_demand = false, - - -- Enables support for roslyn analyzers, code fixes and rulesets. - enable_roslyn_analyzers = false, - - -- Specifies whether 'using' directives should be grouped and sorted during - -- document formatting. - organize_imports_on_format = false, - - -- Enables support for showing unimported types and unimported extension - -- methods in completion lists. When committed, the appropriate using - -- directive will be added at the top of the current file. This option can - -- have a negative impact on initial completion responsiveness, - -- particularly for the first few completion sessions after opening a - -- solution. - enable_import_completion = false, - - -- Specifies whether to include preview versions of the .NET SDK when - -- determining which version to use for project loading. - sdk_include_prereleases = true, - - -- Only run analyzers against open files when 'enableRoslynAnalyzers' is - -- true - analyze_open_documents_only = false, - on_new_config = function(new_config, _) - -- Get the initially configured value of `cmd` - new_config.cmd = { unpack(new_config.cmd or {}) } - - -- Append hard-coded command arguments - table.insert(new_config.cmd, '-z') -- https://github.com/OmniSharp/omnisharp-vscode/pull/4300 - vim.list_extend(new_config.cmd, { '--hostPID', tostring(vim.fn.getpid()) }) - table.insert(new_config.cmd, 'DotNet:enablePackageRestore=false') - vim.list_extend(new_config.cmd, { '--encoding', 'utf-8' }) - table.insert(new_config.cmd, '--languageserver') - - -- Append configuration-dependent command arguments - if new_config.enable_editorconfig_support then - table.insert(new_config.cmd, 'FormattingOptions:EnableEditorConfigSupport=true') - end - - if new_config.organize_imports_on_format then - table.insert(new_config.cmd, 'FormattingOptions:OrganizeImports=true') - end - - if new_config.enable_ms_build_load_projects_on_demand then - table.insert(new_config.cmd, 'MsBuild:LoadProjectsOnDemand=true') - end - - if new_config.enable_roslyn_analyzers then - table.insert(new_config.cmd, 'RoslynExtensionsOptions:EnableAnalyzersSupport=true') - end - - if new_config.enable_import_completion then - table.insert(new_config.cmd, 'RoslynExtensionsOptions:EnableImportCompletion=true') - end - - if new_config.sdk_include_prereleases then - table.insert(new_config.cmd, 'Sdk:IncludePrereleases=true') - end - - if new_config.analyze_open_documents_only then - table.insert(new_config.cmd, 'RoslynExtensionsOptions:AnalyzeOpenDocumentsOnly=true') - end - - -- Disable the handling of multiple workspaces in a single instance - new_config.capabilities = vim.deepcopy(new_config.capabilities) - new_config.capabilities.workspace.workspaceFolders = false -- https://github.com/OmniSharp/omnisharp-roslyn/issues/909 - end, - init_options = {}, - } -} +}) diff --git a/lua/lspconf/lua.lua b/lua/lspconf/lua.lua index 85b350c..51a883e 100644 --- a/lua/lspconf/lua.lua +++ b/lua/lspconf/lua.lua @@ -1,29 +1,31 @@ -local lspconfig = require('lspconfig') +local lspconfig = require("lspconfig") +local my_conf = require("lspconf") -lspconfig.lua_ls.setup { - settings = { - Lua = { - runtime = { - -- Tell the language server which version of Lua you're using - -- (most likely LuaJIT in the case of Neovim) - version = 'LuaJIT', - }, - diagnostics = { - -- Get the language server to recognize the `vim` global - globals = { - 'vim', - 'require', - 'opt', - }, - }, - workspace = { - -- Make the server aware of Neovim runtime files - library = vim.api.nvim_get_runtime_file("", true), - }, - -- Do not send telemetry data containing a randomized but unique identifier - telemetry = { - enable = false, - }, - }, - }, -} +lspconfig.lua_ls.setup({ + on_attach = my_conf.on_attach, + settings = { + Lua = { + runtime = { + -- Tell the language server which version of Lua you're using + -- (most likely LuaJIT in the case of Neovim) + version = "LuaJIT", + }, + diagnostics = { + -- Get the language server to recognize the `vim` global + globals = { + "vim", + "require", + "opt", + }, + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true), + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false, + }, + }, + }, +}) diff --git a/lua/plugin/avante.lua b/lua/plugin/avante.lua new file mode 100644 index 0000000..1e1d779 --- /dev/null +++ b/lua/plugin/avante.lua @@ -0,0 +1,12 @@ +require('avante').setup({ +provider = 'copilot', + providers = { + copilot = { + model = "claude-3.7-sonnet", + timeout = 30000, -- Timeout in milliseconds + }, + }, + selector = { + exclude_auto_select = { "oil" }, + }, +}) diff --git a/lua/plugin/cmp.lua b/lua/plugin/cmp.lua new file mode 100644 index 0000000..c2cc6db --- /dev/null +++ b/lua/plugin/cmp.lua @@ -0,0 +1,25 @@ +local cmp = require("cmp") + +cmp.setup({ + snippet = { + expand = function(args) + require("luasnip").lsp_expand(args.body) -- For `luasnip` users. + end, + }, + window = { + completion = cmp.config.window.bordered(), + documentation = cmp.config.window.bordered(), + }, + mapping = cmp.mapping.preset.insert({ + [""] = cmp.mapping.scroll_docs(-4), + [""] = cmp.mapping.scroll_docs(4), + [""] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. + }), + + sources = cmp.config.sources({ + { name = "nvim_lsp" }, + { name = "luasnip" }, -- For luasnip users. + }, { + { name = "buffer" }, + }), +}) diff --git a/lua/plugin/formatter.lua b/lua/plugin/formatter.lua index 48f5e6d..cfe2674 100644 --- a/lua/plugin/formatter.lua +++ b/lua/plugin/formatter.lua @@ -1,10 +1,10 @@ local formatter = require("conform") formatter.setup({ - formatters_by_ft = { - lua = { "stylua" }, - -- Use a sub-list to run only the first available formatter - javascript = { { "prettierd", "prettier" } }, - typescript = { { "prettier" } }, - }, + formatters_by_ft = { + lua = { "stylua" }, + -- Use a sub-list to run only the first available formatter + javascript = { "prettierd", "prettier" }, + typescript = { "prettier" }, + }, }) diff --git a/lua/plugin/snacks.lua b/lua/plugin/snacks.lua new file mode 100644 index 0000000..6e24f0d --- /dev/null +++ b/lua/plugin/snacks.lua @@ -0,0 +1,10 @@ +local Snacks = require('snacks') + +-- Picker +vim.keymap.set('n', 'ff', function() Snacks.picker.smart() end, {}) +vim.keymap.set('n', 'fg', function() Snacks.picker.grep() end, {}) +vim.keymap.set('n', 'jj', function() Snacks.picker.buffers() end, {}) +vim.keymap.set('n', 'fh', function() Snacks.picker.comand_history() end, {}) + +-- LazyGit +vim.keymap.set("n", "gg", function() Snacks.lazygit() end, {}) diff --git a/lua/plugin/telescope.lua b/lua/plugin/telescope.lua deleted file mode 100644 index 0b00d89..0000000 --- a/lua/plugin/telescope.lua +++ /dev/null @@ -1,69 +0,0 @@ -local telescope = require('telescope') -local builtin = require('telescope.builtin') - -telescope.setup({ - defaults = { - vimgrep_arguments = { - "rg", - "-L", - "--color=never", - "--no-heading", - "--with-filename", - "--line-number", - "--column", - "--smart-case", - }, - prompt_prefix = "  ", - selection_caret = " ", - entry_prefix = " ", - initial_mode = "insert", - selection_strategy = "reset", - sorting_strategy = "ascending", - layout_strategy = "horizontal", - layout_config = { - horizontal = { - prompt_position = "top", - preview_width = 0.55, - results_width = 0.8, - }, - vertical = { - mirror = false, - }, - width = 0.87, - height = 0.80, - preview_cutoff = 120, - }, - file_sorter = require("telescope.sorters").get_fuzzy_file, - file_ignore_patterns = { "node_modules", ".git", ".angular" }, - generic_sorter = require("telescope.sorters").get_generic_fuzzy_sorter, - path_display = { "truncate" }, - winblend = 0, - border = {}, - borderchars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" }, - color_devicons = true, - set_env = { ["COLORTERM"] = "truecolor" }, -- default = nil, - file_previewer = require("telescope.previewers").vim_buffer_cat.new, - grep_previewer = require("telescope.previewers").vim_buffer_vimgrep.new, - qflist_previewer = require("telescope.previewers").vim_buffer_qflist.new, - -- Developer configurations: Not meant for general override - buffer_previewer_maker = require("telescope.previewers").buffer_previewer_maker, - mappings = { - n = { ["q"] = require("telescope.actions").close }, - }, - }, - - extensions_list = { "themes", "terms", "fzf" }, - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - }, -}) - -vim.keymap.set('n', 'ff', builtin.find_files, {}) -vim.keymap.set('n', 'fg', builtin.live_grep, {}) -vim.keymap.set('n', 'jj', builtin.buffers, {}) -vim.keymap.set('n', 'fh', builtin.help_tags, {}) diff --git a/lua/plugins.lua b/lua/plugins.lua index 6b16a08..6a2cb36 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -14,69 +14,61 @@ end vim.opt.rtp:prepend(lazypath) require("lazy").setup({ - { - 'nvim-telescope/telescope.nvim', - tag = '0.1.2', - dependencies = { 'nvim-lua/plenary.nvim' } - }, - -- themes { 'gruvbox-community/gruvbox' }, - -- gitsigns { 'lewis6991/gitsigns.nvim' }, - -- tpope commentary { 'tpope/vim-commentary' }, - + { + "folke/snacks.nvim", + priority = 1000, + lazy = false, + opts = { + -- bigfile = { enabled = true }, + -- dashboard = { enabled = true }, + -- explorer = { enabled = true }, + -- animate = { enabled = true }, + explorer = { enabled = true }, + indent = { enabled = true }, + input = { enabled = true }, + picker = { enabled = true }, + -- notifier = { enabled = true }, + -- quickfile = { enabled = true }, + -- scope = { enabled = true }, + scroll = { enabled = true }, + statuscolumn = { enabled = true }, + -- words = { enabled = true }, + lazygit = { enabled = true }, + }, + }, { "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" }, - { - 'VonHeikemen/lsp-zero.nvim', - branch = 'v2.x', - dependencies = { - -- LSP Support - { 'neovim/nvim-lspconfig' }, -- Required - { -- Optional - 'williamboman/mason.nvim', - build = function() - pcall(vim.cmd, 'MasonUpdate') - end, - }, - { 'williamboman/mason-lspconfig.nvim' }, -- Optional - -- formatter - { - 'stevearc/conform.nvim', - opts = { - formatters_by_ft = { - htmlangular = { "prettier" }, - }, - }, - }, - -- Autocompletion - { 'hrsh7th/nvim-cmp' }, -- Required - { 'hrsh7th/cmp-nvim-lsp' }, -- Required - { 'L3MON4D3/LuaSnip' }, -- Required - { 'nvim-cmp' }, - -- { 'rcarriga/nvim-dap-ui', dependencies = { 'mfussenegger/nvim-dap' } }, - } + { 'neovim/nvim-lspconfig' }, -- Required + { -- Optional + 'williamboman/mason.nvim', + build = function() + pcall(vim.cmd, 'MasonUpdate') + end, }, + { 'williamboman/mason-lspconfig.nvim' }, -- Optional + { + 'stevearc/conform.nvim', + }, + -- Autocompletion + { 'hrsh7th/nvim-cmp' }, -- Required + { 'hrsh7th/cmp-nvim-lsp' }, -- Required + { 'L3MON4D3/LuaSnip' }, -- Required + -- roslyn { "seblyng/roslyn.nvim", ft = "cs", - -- @module 'roslyn.config' - -- @type RoslynNvimConfig opts = { -- your configuration comes here; leave empty for default settings }, }, { 'stevearc/oil.nvim', - ---@module 'oil' - ---@type oil.SetupOpts opts = {}, - -- Optional dependencies dependencies = { { "echasnovski/mini.icons", opts = {} } }, - -- dependencies = { "nvim-tree/nvim-web-devicons" }, -- use if you prefer nvim-web-devicons - -- Lazy loading is not recommended because it is very tricky to make it work correctly in all situations. lazy = false, }, { @@ -84,13 +76,6 @@ require("lazy").setup({ branch = "harpoon2", dependencies = { "nvim-lua/plenary.nvim" } }, - { - "kdheepak/lazygit.nvim", - -- optional for floating window border decoration - dependencies = { - "nvim-lua/plenary.nvim", - }, - }, { "iamcco/markdown-preview.nvim", cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, @@ -98,6 +83,82 @@ require("lazy").setup({ build = function() vim.fn["mkdp#util#install"]() end, }, { 'mhinz/vim-startify' }, + { + '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, + }, + { + "yetone/avante.nvim", + -- if you want to build from source then do `make BUILD_FROM_SOURCE=true` + -- ⚠️ must add this setting! ! ! + build = function() + -- conditionally use the correct build system for the current OS + if vim.fn.has("win32") == 1 then + return "powershell -ExecutionPolicy Bypass -File Build.ps1 -BuildFromSource false" + else + return "make" + end + + end, + event = "VeryLazy", + version = false, -- Never set this value to "*"! Never! + + dependencies = { + "nvim-lua/plenary.nvim", + "MunifTanjim/nui.nvim", + + --- The below dependencies are optional, + + "echasnovski/mini.pick", -- for file_selector provider mini.pick + "nvim-telescope/telescope.nvim", -- for file_selector provider telescope + "hrsh7th/nvim-cmp", -- autocompletion for avante commands and mentions + "ibhagwan/fzf-lua", -- for file_selector provider fzf + "stevearc/dressing.nvim", -- for input provider dressing + "folke/snacks.nvim", -- for input provider snacks + "nvim-tree/nvim-web-devicons", -- or echasnovski/mini.icons + "zbirenbaum/copilot.lua", -- for providers='copilot' + { + -- support for image pasting + "HakonHarnes/img-clip.nvim", + event = "VeryLazy", + opts = { + -- recommended settings + default = { + + embed_image_as_base64 = false, + prompt_for_file_name = false, + drag_and_drop = { + insert_mode = true, + }, + -- required for Windows users + use_absolute_path = true, + }, + + }, + }, + { + -- Make sure to set this up properly if you have lazy=true + 'MeanderingProgrammer/render-markdown.nvim', + opts = { + file_types = { "markdown", "Avante" }, + }, + ft = { "markdown", "Avante" }, + }, + }, + } }, opts) diff --git a/lua/remap.lua b/lua/remap.lua index f65c9a1..dd1c1aa 100644 --- a/lua/remap.lua +++ b/lua/remap.lua @@ -22,5 +22,6 @@ vim.keymap.set("n", "", ":bp") vim.keymap.set("n", "t2", ":set expandtab shiftwidth=2 softtabstop=2") vim.keymap.set("n", "t4", ":set expandtab shiftwidth=4 softtabstop=4") vim.keymap.set("n", "t", ":set noexpandtab shiftwidth=4 softtabstop=4") --- LazyGit -vim.keymap.set("n", "gg", ":LazyGit") + +vim.keymap.set("n", "gt", ":wincmd s :wincmd T") +vim.keymap.set("n", "tc", ":tabc") diff --git a/lua/set.lua b/lua/set.lua index 4f4aacc..cf691ec 100644 --- a/lua/set.lua +++ b/lua/set.lua @@ -11,11 +11,11 @@ vim.opt.smartindent = true vim.opt.wrap = false vim.opt.list = true +vim.opt.laststatus = 3 vim.opt.swapfile = false vim.opt.backup = false --- vim.opt.undodir = os.getenv("HOME") .. "/.vim/undodir" vim.opt.undofile = true vim.opt.hlsearch = true @@ -25,7 +25,7 @@ vim.opt.smartcase = true vim.opt.termguicolors = true -vim.opt.scrolloff = 8 +vim.opt.scrolloff = 10 vim.opt.signcolumn = "yes" vim.opt.updatetime = 50