From 71c5cb4f0be89d3a175e99b0c2ebc5e55178e8a9 Mon Sep 17 00:00:00 2001 From: Rafael Date: Mon, 5 Jul 2021 20:01:19 +0000 Subject: (feat) use neoformat as the defalt format option (#715) --- lua/default-config.lua | 31 +++---------------------------- lua/plugins.lua | 5 ++++- 2 files changed, 7 insertions(+), 29 deletions(-) (limited to 'lua') diff --git a/lua/default-config.lua b/lua/default-config.lua index ce7b1062..e05fc9e3 100644 --- a/lua/default-config.lua +++ b/lua/default-config.lua @@ -4,7 +4,7 @@ CACHE_PATH = vim.fn.stdpath "cache" TERMINAL = vim.fn.expand "$TERMINAL" O = { - + format_on_save = true, auto_close_tree = 0, auto_complete = true, colorscheme = "lunar", @@ -33,7 +33,7 @@ O = { }, lsp = { - popup_border = "single" + popup_border = "single", }, database = { save_location = "~/.config/nvcode_db", auto_execute = 1 }, @@ -97,9 +97,6 @@ O = { lang = { python = { linter = "", - -- @usage can be 'yapf', 'black' - formatter = "", - autoformat = false, isort = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, @@ -116,9 +113,6 @@ O = { sdk_path = "/usr/lib/dart/bin/snapshots/analysis_server.dart.snapshot", }, lua = { - -- @usage can be 'lua-format' - formatter = "", - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -129,8 +123,6 @@ O = { -- @usage can be 'shellcheck' linter = "", -- @usage can be 'shfmt' - formatter = "", - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -140,9 +132,6 @@ O = { tsserver = { -- @usage can be 'eslint' linter = "", - -- @usage can be 'prettier' - formatter = "", - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -150,9 +139,6 @@ O = { }, }, json = { - -- @usage can be 'prettier' - formatter = "", - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -178,7 +164,6 @@ O = { }, cross_file_rename = true, header_insertion = "never", - autoformat = false, -- update this to true for enabling autoformat }, ruby = { diagnostics = { @@ -198,8 +183,6 @@ O = { active = false, }, linter = "", - formatter = "", - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -208,13 +191,9 @@ O = { }, svelte = {}, php = { - format = { - braces = "psr12", - }, environment = { php_version = "7.4", }, - autoformat = false, diagnostics = { virtual_text = { spacing = 0, prefix = "" }, signs = true, @@ -233,8 +212,6 @@ O = { cmake = {}, java = {}, css = { - formatter = "", - autoformat = false, virtual_text = true, }, }, @@ -263,6 +240,4 @@ O = { }, footer = { "chrisatmachine.com" }, }, -} - - +} \ No newline at end of file diff --git a/lua/plugins.lua b/lua/plugins.lua index b14cac46..8752a1ba 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -66,6 +66,9 @@ return require("packer").startup(function(use) -- Treesitter use { "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" } + -- Neoformat + use { "sbdchd/neoformat", event = "BufEnter" } + use { "kyazdani42/nvim-tree.lua", -- cmd = "NvimTreeToggle", @@ -435,7 +438,7 @@ return require("packer").startup(function(use) "typescript", "typescriptreact", "typescript.tsx", - } + }, } -- use { -- "jose-elias-alvarez/null-ls.nvim", -- cgit v1.2.3 From 9b10d9298c58981b59beea11c140907f32533022 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 5 Jul 2021 16:17:51 -0400 Subject: going back to barbar --- lua/lv-which-key/init.lua | 46 +++++++++++++++++++++++----------------------- lua/plugins.lua | 34 ++++++++++++++++++++++++++-------- 2 files changed, 49 insertions(+), 31 deletions(-) (limited to 'lua') diff --git a/lua/lv-which-key/init.lua b/lua/lv-which-key/init.lua index d5ad771f..084be113 100644 --- a/lua/lv-which-key/init.lua +++ b/lua/lv-which-key/init.lua @@ -87,7 +87,7 @@ vim.api.nvim_set_keymap("n", "/", ":CommentToggle", { noremap = true vim.api.nvim_set_keymap("v", "/", ":CommentToggle", { noremap = true, silent = true }) -- close buffer -vim.api.nvim_set_keymap("n", "c", ":bdelete!", { noremap = true, silent = true }) +vim.api.nvim_set_keymap("n", "c", ":BufferClose", { noremap = true, silent = true }) -- TODO create entire treesitter section @@ -121,14 +121,14 @@ local mappings = { "sort BufferLines automatically by language", }, }, - p = { - name = "Packer", - c = {"PackerCompile", "Compile"}, - i = {"PackerInstall", "Install"}, - r = {":luafile %", "Reload"}, - s = {"PackerSync", "Sync"}, - u = {"PackerUpdate", "Update"} - }, + p = { + name = "Packer", + c = { "PackerCompile", "Compile" }, + i = { "PackerInstall", "Install" }, + r = { ":luafile %", "Reload" }, + s = { "PackerSync", "Sync" }, + u = { "PackerUpdate", "Update" }, + }, -- diagnostics vanilla nvim -- -- diagnostic -- function lv_utils.get_all() @@ -158,20 +158,20 @@ local mappings = { -- " https://microsoft.github.io/debug-adapter-protocol/ -- " Debugging d = { - name = "Debug", - t = {"lua require'dap'.toggle_breakpoint()", "Toggle Breakpoint"}, - b = {"lua require'dap'.step_back()", "Step Back"}, - c = {"lua require'dap'.continue()", "Continue"}, - C = {"lua require'dap'.run_to_cursor()", "Run To Cursor"}, - d = {"lua require'dap'.disconnect()", "Disconnect"}, - g = {"lua require'dap'.session()", "Get Session"}, - i = {"lua require'dap'.step_into()", "Step Into"}, - o = {"lua require'dap'.step_over()", "Step Over"}, - u = {"lua require'dap'.step_out()", "Step Out"}, - p = {"lua require'dap'.pause.toggle()", "Pause"}, - r = {"lua require'dap'.repl.toggle()", "Toggle Repl"}, - s = {"lua require'dap'.continue()", "Start"}, - q = {"lua require'dap'.stop()", "Quit"} + name = "Debug", + t = { "lua require'dap'.toggle_breakpoint()", "Toggle Breakpoint" }, + b = { "lua require'dap'.step_back()", "Step Back" }, + c = { "lua require'dap'.continue()", "Continue" }, + C = { "lua require'dap'.run_to_cursor()", "Run To Cursor" }, + d = { "lua require'dap'.disconnect()", "Disconnect" }, + g = { "lua require'dap'.session()", "Get Session" }, + i = { "lua require'dap'.step_into()", "Step Into" }, + o = { "lua require'dap'.step_over()", "Step Over" }, + u = { "lua require'dap'.step_out()", "Step Out" }, + p = { "lua require'dap'.pause.toggle()", "Pause" }, + r = { "lua require'dap'.repl.toggle()", "Toggle Repl" }, + s = { "lua require'dap'.continue()", "Start" }, + q = { "lua require'dap'.stop()", "Quit" }, }, g = { name = "Git", diff --git a/lua/plugins.lua b/lua/plugins.lua index 8752a1ba..4ae2ec1a 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -118,13 +118,21 @@ return require("packer").startup(function(use) use { "glepnir/galaxyline.nvim" } use { - "akinsho/nvim-bufferline.lua", + "romgrk/barbar.nvim", config = function() - require("lv-bufferline").config() + vim.api.nvim_set_keymap("n", "", ":BufferNext", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "", ":BufferPrevious", { noremap = true, silent = true }) + vim.api.nvim_set_keymap("n", "", ":BufferClose", { noremap = true, silent = true }) end, event = "BufRead", } + -- use { + -- "akinsho/nvim-bufferline.lua", + -- config = function() require("lv-bufferline").config() end, + -- event = "BufRead" + -- } + -- Extras, these do not load by default -- Better motions @@ -224,7 +232,11 @@ return require("packer").startup(function(use) vim.g.indentLine_enabled = 1 vim.g.indent_blankline_char = "▏" - vim.g.indent_blankline_filetype_exclude = { "help", "terminal", "dashboard" } + vim.g.indent_blankline_filetype_exclude = { + "help", + "terminal", + "dashboard", + } vim.g.indent_blankline_buftype_exclude = { "terminal" } vim.g.indent_blankline_show_trailing_blankline_indent = false @@ -256,9 +268,14 @@ return require("packer").startup(function(use) use { "mfussenegger/nvim-dap", config = function() - require('dap') - vim.fn.sign_define('DapBreakpoint', {text='', texthl='LspDiagnosticsSignError', linehl='', numhl=''}) - require('dap').defaults.fallback.terminal_win_cmd = '50vsplit new' + require "dap" + vim.fn.sign_define("DapBreakpoint", { + text = "", + texthl = "LspDiagnosticsSignError", + linehl = "", + numhl = "", + }) + require("dap").defaults.fallback.terminal_win_cmd = "50vsplit new" end, disable = not O.plugin.debug.active, } @@ -462,6 +479,7 @@ return require("packer").startup(function(use) requires = "hrsh7th/nvim-compe", disable = not O.plugin.tabnine.active, } - for _, plugin in pairs(O.custom_plugins) do packer.use(plugin) end - + for _, plugin in pairs(O.custom_plugins) do + packer.use(plugin) + end end) -- cgit v1.2.3 From d4822c2920336287579c74a5b37f0aa08402b871 Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 5 Jul 2021 16:20:14 -0400 Subject: no lazyloading barbar --- lua/plugins.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/plugins.lua b/lua/plugins.lua index 4ae2ec1a..7c35c264 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -124,7 +124,7 @@ return require("packer").startup(function(use) vim.api.nvim_set_keymap("n", "", ":BufferPrevious", { noremap = true, silent = true }) vim.api.nvim_set_keymap("n", "", ":BufferClose", { noremap = true, silent = true }) end, - event = "BufRead", + -- event = "BufRead", } -- use { -- cgit v1.2.3 From a469c710bfc01f291df68dba40464caaa2b496da Mon Sep 17 00:00:00 2001 From: christianchiarulli Date: Mon, 5 Jul 2021 16:21:26 -0400 Subject: no lazyload lspinstall --- lua/plugins.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lua') diff --git a/lua/plugins.lua b/lua/plugins.lua index 7c35c264..2b215291 100644 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -32,7 +32,7 @@ return require("packer").startup(function(use) -- TODO refactor all of this (for now it works, but yes I know it could be wrapped in a simpler function) use { "neovim/nvim-lspconfig" } - use { "kabouzeid/nvim-lspinstall", cmd = "LspInstall" } + use { "kabouzeid/nvim-lspinstall" } -- Telescope use { "nvim-lua/popup.nvim" } use { "nvim-lua/plenary.nvim" } -- cgit v1.2.3