diff --git a/.stylua.toml b/.stylua.toml deleted file mode 100644 index 5d12dbdf..00000000 --- a/.stylua.toml +++ /dev/null @@ -1,6 +0,0 @@ -column_width = 160 -line_endings = "Unix" -indent_type = "Spaces" -indent_width = 2 -quote_style = "AutoPreferSingle" -no_call_parentheses = true diff --git a/init.lua b/init.lua index c09fb8d5..0d7f788b 100644 --- a/init.lua +++ b/init.lua @@ -116,29 +116,30 @@ require('lazy').setup({ }, }, - -- { - -- -- Theme inspired by Atom - -- 'navarasu/onedark.nvim', - -- priority = 1000, - -- config = function() - -- require('onedark').setup { - -- style = 'dark', - -- code_style = { - -- comments = 'none', - -- }, - -- } - -- require('onedark').load() - -- vim.cmd.colorscheme 'onedark' - -- end, - -- }, { - 'morhetz/gruvbox', + -- Theme inspired by Atom + 'navarasu/onedark.nvim', + priority = 1000, config = function() - vim.cmd.colorscheme 'gruvbox' - vim.o.background = 'dark' - vim.o.termguicolors = true - end + require('onedark').setup { + style = 'warmer', + transparent = true, + -- code_style = { + -- comments = 'none', + -- }, + } + require('onedark').load() + vim.cmd.colorscheme 'onedark' + end, }, + -- { + -- 'morhetz/gruvbox', + -- config = function() + -- vim.cmd.colorscheme 'gruvbox' + -- vim.o.background = 'dark' + -- vim.o.termguicolors = true + -- end + -- }, { -- Set lualine as statusline @@ -266,7 +267,7 @@ vim.o.number = true vim.o.scrolloff = 5 vim.o.sidescrolloff = 10 --- Set tabs to 4 spaces +-- Set tabs to 2 spaces vim.o.tabstop = 2 vim.o.softtabstop = 2 @@ -473,7 +474,7 @@ local servers = { dockerls = {}, -- gradle_ls = {}, pyright = {}, - tsserver = {}, + ts_ls = {}, html = {}, jsonls = {}, -- jdtls = {}, diff --git a/lua/custom/plugins/abolish.lua b/lua/custom/plugins/abolish.lua new file mode 100644 index 00000000..c93e2d9e --- /dev/null +++ b/lua/custom/plugins/abolish.lua @@ -0,0 +1,4 @@ +-- User :%S to replace words with smart case +return { + 'tpope/vim-abolish', +} diff --git a/lua/custom/plugins/autosession.lua b/lua/custom/plugins/autosession.lua index 9054d50b..fe4e2518 100644 --- a/lua/custom/plugins/autosession.lua +++ b/lua/custom/plugins/autosession.lua @@ -2,24 +2,24 @@ return { 'rmagatti/auto-session', config = function() require("auto-session").setup { - log_level = "error", - auto_session_suppress_dirs = { "~/", "~/Downloads", "/"}, - auto_save_enabled = true, + suppressed_dirs = { "~/", "~/Downloads", "/" }, + use_git_branch = true, auto_restore_enabled = true, - auto_session_use_git_branch = true, - auto_session_enable_last_session = true, - pre_save_cmds = { - "NeoTreeClose" - }, - post_save_cmds = { - "NeoTreeReveal" - }, - pre_restore_cmds = { - "NeoTreeClose" - }, - post_restore_cmds = { - "NeoTreeReveal" + pre_cwd_changed_cmds = { + "Neotree close" }, + -- pre_save_cmds = { + -- "tabdo Neotree close" + -- }, + -- post_save_cmds = { + -- "tabdo Neotree" + -- }, + -- pre_restore_cmds = { + -- "tabdo Neotree close" + -- }, + -- post_restore_cmds = { + -- "tabdo Neotree" + -- }, } end } diff --git a/lua/custom/plugins/filetree.lua b/lua/custom/plugins/filetree.lua index f29e7bc0..6af43873 100644 --- a/lua/custom/plugins/filetree.lua +++ b/lua/custom/plugins/filetree.lua @@ -6,7 +6,7 @@ return { "nvim-tree/nvim-web-devicons", -- not strictly required, but recommended "MunifTanjim/nui.nvim", }, - config = function () + config = function() -- Unless you are still migrating, remove the deprecated commands from v1.x vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]]) @@ -14,7 +14,7 @@ return { close_if_last_window = true, } - vim.keymap.set('n', 'nf', ':NeoTreeFloatToggle', { desc = '[N]eoTree [F]loat Toggle' }) - vim.keymap.set('n', 'nr', ':NeoTreeRevealToggle', { desc = '[N]eoTree [R]eveal Toggle' }) + vim.keymap.set('n', 'nf', ':Neotree show float toggle', { desc = '[N]eoTree [F]loat Toggle' }) + vim.keymap.set('n', 'nr', ':Neotree show toggle', { desc = '[N]eoTree [R]eveal Toggle' }) end, } diff --git a/lua/custom/plugins/go.lua b/lua/custom/plugins/go.lua index ebc0063c..94d35f51 100644 --- a/lua/custom/plugins/go.lua +++ b/lua/custom/plugins/go.lua @@ -1,18 +1,12 @@ return { 'ray-x/go.nvim', requires = { - 'ray-x/guihua.lua' + 'ray-x/guihua.lua', + 'neovim/nvim-lspconfig', + 'nvim-treesitter/nvim-treesitter', }, config = function() - require("go").setup() - local format_sync_grp = vim.api.nvim_create_augroup("GoImport", {}) - vim.api.nvim_create_autocmd("BufWritePre", { - pattern = "*.go", - callback = function() - require('go.format').goimport() - end, - group = format_sync_grp, - }) + require('go').setup() end, event = { 'CmdlineEnter' }, ft = { 'go', 'gomod' }, diff --git a/lua/custom/plugins/markdown.lua b/lua/custom/plugins/markdown.lua new file mode 100644 index 00000000..92836b23 --- /dev/null +++ b/lua/custom/plugins/markdown.lua @@ -0,0 +1,9 @@ +return { + "iamcco/markdown-preview.nvim", + cmd = { "MarkdownPreviewToggle", "MarkdownPreview", "MarkdownPreviewStop" }, + ft = { "markdown" }, + build = "cd app && yarn install", + init = function() + vim.g.mkdp_filetypes = { "markdown" } + end +} diff --git a/lua/kickstart/plugins/autoformat.lua b/lua/kickstart/plugins/autoformat.lua index bc56b15b..ac3e2ab7 100644 --- a/lua/kickstart/plugins/autoformat.lua +++ b/lua/kickstart/plugins/autoformat.lua @@ -5,7 +5,12 @@ return { 'neovim/nvim-lspconfig', + dependencies = { + 'ray-x/go.nvim', + 'ray-x/guihua.lua', + }, config = function() + require("go").setup() -- Switch for controlling whether you want autoformatting. -- Use :KickstartFormatToggle to toggle autoformatting on or off local format_is_enabled = true @@ -60,12 +65,16 @@ return { return end - vim.lsp.buf.format { - async = false, - filter = function(c) - return c.id == client.id - end, - } + if vim.bo.filetype == 'go' then + require('go.format').goimport() + else + vim.lsp.buf.format { + async = false, + filter = function(c) + return c.id == client.id + end, + } + end end, }) end, diff --git a/lua/kickstart/plugins/debug.lua b/lua/kickstart/plugins/debug.lua index d2f01b95..b65ee569 100644 --- a/lua/kickstart/plugins/debug.lua +++ b/lua/kickstart/plugins/debug.lua @@ -24,22 +24,49 @@ return { 'leoluz/nvim-dap-go', 'microsoft/vscode-js-debug', 'mxsdev/nvim-dap-vscode-js', + 'julianolf/nvim-dap-lldb', + 'vadimcn/codelldb', }, config = function() local dap = require 'dap' local dapui = require 'dapui' + dap.adapters.lldb = { + type = 'server', + command = vim.fn.expand('$HOME/.local/share/nvim/mason/bin/codelldb'), + host = '127.0.0.1', + port = 13000, + } + + dap.configurations.cpp = { + { + name = 'Launch Editor (Development)', + type = 'lldb', + request = 'launch', + program = '/home/wil/dev/ue5/Engine/Binaries/Linux/UnrealEditor', + preLaunchTask = 'Editor Linux Development Build', + args = { + '/home/wil/dev/sro/game/SRO.uproject', + '--port ${port}', + }, + -- terminal = 'integrated', + cwd = '/home/wil/dev/ue5', + -- visualizerFile = '/home/wil/dev/ue5/Engine/Extras/VisualStudioDebugging/Unreal.natvis', + -- showDisplayString = 'true', + }, + } + require('mason-nvim-dap').setup { -- Makes a best effort to setup the various debuggers with -- reasonable debug configurations - automatic_setup = false, + automatic_installation = true, -- You'll need to check that you have the required things installed -- online, please don't ask me how to install them :) ensure_installed = { -- Update this to ensure that you have the debuggers for the langs you want - 'delve', + -- 'delve', 'js', 'node2', 'cppdbg', @@ -86,8 +113,8 @@ return { } dap.listeners.after.event_initialized['dapui_config'] = dapui.open - dap.listeners.before.event_terminated['dapui_config'] = dapui.close - dap.listeners.before.event_exited['dapui_config'] = dapui.close + -- dap.listeners.before.event_terminated['dapui_config'] = dapui.close + -- dap.listeners.before.event_exited['dapui_config'] = dapui.close dap.defaults.fallback.exception_breakpoints = { 'Notice', 'Warning', 'Error', 'Exception' } @@ -101,6 +128,7 @@ return { adapters = { "pwa-node", "pwa-chrome", "pwa-msedge", "node-terminal", "pwa-extensionHost" }, } + for _, jsLang in ipairs({ 'typescript', 'javascript' }) do require("dap").configurations[jsLang] = { {