aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/nvim/.config
diff options
context:
space:
mode:
authorToby Vincent <tobyv13@gmail.com>2022-04-07 10:22:47 -0500
committerToby Vincent <tobyv13@gmail.com>2022-04-07 10:22:47 -0500
commit5f8553132579520c33ec940cb8e56c752c58e272 (patch)
treefb23e66d270d6dc7989a76327ade3e36d98b4b8b /nvim/.config
parent29df843de1f83c98460967319182bb3742140957 (diff)
fix: neovim config bugfixes
Diffstat (limited to 'nvim/.config')
-rw-r--r--nvim/.config/nvim/lua/mappings.lua70
-rw-r--r--nvim/.config/nvim/lua/plugins.lua527
-rw-r--r--nvim/.config/nvim/lua/plugins/neo-tree.lua73
-rw-r--r--nvim/.config/nvim/lua/plugins/null-ls.lua47
-rw-r--r--nvim/.config/nvim/lua/plugins/which-key.lua2
5 files changed, 432 insertions, 287 deletions
diff --git a/nvim/.config/nvim/lua/mappings.lua b/nvim/.config/nvim/lua/mappings.lua
index 3b6c7d5..0a21f77 100644
--- a/nvim/.config/nvim/lua/mappings.lua
+++ b/nvim/.config/nvim/lua/mappings.lua
@@ -13,7 +13,7 @@ local opts = {
local mappings = {
-- Ctrl maps
["<C-s>"] = { "<cmd>w!<CR>", "Save" },
- ["<C-b>"] = { "<Cmd>NvimTreeToggle<CR>", "Explorer" },
+ ["<C-b>"] = { "<Cmd>Neotree focus toggle<CR>", "Explorer" },
}
local nopts = {
@@ -112,6 +112,7 @@ local nmappings = {
p = {
name = "Packer",
c = { "<cmd>PackerCompile<cr>", "Compile" },
+ C = { "<cmd>PackerClean<cr>", "Clean" },
i = { "<cmd>PackerInstall<cr>", "Install" },
s = { "<cmd>PackerSync<cr>", "Sync" },
S = { "<cmd>PackerStatus<cr>", "Status" },
@@ -180,14 +181,77 @@ local vopts = {
local vmappings = {
-- Ctrl maps
["<C-/>"] = { "<ESC><CMD>lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())<CR>", "Comment" },
-
+
-- Prefix "<leader>"
["<leader>"] = {
["/"] = { "<ESC><CMD>lua require('Comment.api').toggle_linewise_op(vim.fn.visualmode())<CR>", "Comment" },
- }
+ },
+}
+
+local iopts = {
+ mode = "i", -- INSERT mode
+ buffer = nil, -- Global mappings. Specify a buffer number for buffer local mappings
+ silent = true, -- use `silent` when creating keymaps
+ noremap = true, -- use `noremap` when creating keymaps
+ nowait = true, -- use `nowait` when creating keymaps
+}
+
+local imappings = {
+ -- Ctrl maps
+ ["<C-h>"] = { "<left>", "Left" },
+ ["<C-j>"] = { "<up>", "Up" },
+ ["<C-k>"] = { "<down>", "Down" },
+ ["<C-l>"] = { "<right>", "Right" },
}
which_key.register(mappings, opts)
which_key.register(nmappings, nopts)
which_key.register(vmappings, vopts)
+which_key.register(imappings, iopts)
+
+function WhichKeyNeoTree(bufNumber)
+ local status_ok, which_key = pcall(require, "which-key")
+ if not status_ok then
+ return
+ end
+
+ vim.g.maplocalleader = " "
+ vim.g.mapleader = ""
+
+ local nopts = {
+ mode = "n",
+ buffer = vim.api.nvim_get_current_buf(),
+ silent = true,
+ noremap = true,
+ nowait = true,
+ }
+
+ local nmappings = {
+ ["<2-LeftMouse>"] = { "<cmd> lua require('neo-tree').open()<cr>", "Open" },
+ ["<cr>"] = { "<cmd> lua require('neo-tree').open()<cr>", "Open" },
+ ["<localleader>"] = {
+ S = { "<cmd> lua require('neo-tree').open_split()<cr>", "HSplit" },
+ s = { "<cmd> lua require('neo-tree').open_vsplit()<cr>", "VSplit" },
+ t = { "<cmd> lua require('neo-tree').open_tabnew()<cr>", "New Tab" },
+ C = { "<cmd> lua require('neo-tree').close_node()<cr>", "Collapse" },
+ z = { "<cmd> lua require('neo-tree').close_all_nodes()<cr>", "Collapse All" },
+ R = { "<cmd> lua require('neo-tree').refresh()<cr>", "Refresh" },
+ a = { "<cmd> lua require('neo-tree').add()<cr>", "Add" },
+ A = { "<cmd> lua require('neo-tree').add_directory()<cr>", "Add Dir" },
+ d = { "<cmd> lua require('neo-tree').delete()<cr>", "Delete" },
+ r = { "<cmd> lua require('neo-tree').rename()<cr>", "Rename" },
+ y = { "<cmd> lua require('neo-tree').copy_to_clipboard()<cr>", "Copy" },
+ x = { "<cmd> lua require('neo-tree').cut_to_clipboard()<cr>", "Cut" },
+ p = { "<cmd> lua require('neo-tree').paste_from_clipboard()<cr>", "Paste" },
+ c = { "<cmd> lua require('neo-tree').copy()<cr>", "Copy To" },
+ m = { "<cmd> lua require('neo-tree').move()<cr>", "Move To" },
+ q = { "<cmd> lua require('neo-tree').close_window()<cr>", "Close" },
+ },
+ }
+ which_key.register(nmappings, nopts)
+end
+
+local bufNo = vim.api.nvim_get_current_buf()
+
+vim.cmd("autocmd FileType neo-tree lua WhichKeyNeoTree(" .. bufNo .. ")")
diff --git a/nvim/.config/nvim/lua/plugins.lua b/nvim/.config/nvim/lua/plugins.lua
index efd0834..2de99be 100644
--- a/nvim/.config/nvim/lua/plugins.lua
+++ b/nvim/.config/nvim/lua/plugins.lua
@@ -1,272 +1,297 @@
local fn = vim.fn
-- Automatically install packer
-local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
+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]]
+ 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 [[
+vim.cmd([[
augroup packer_user_config
autocmd!
autocmd BufWritePost plugins.lua source <afile> | 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
+ return
end
-- Have packer use a popup window
-packer.init {
- display = {
- open_fn = function()
- return require("packer.util").float { border = "rounded" }
- end,
- },
-}
+packer.init({
+ display = {
+ open_fn = function()
+ return require("packer.util").float({ border = "rounded" })
+ end,
+ },
+})
-- Install your plugins here
-return packer.startup(function(use)
- -- My plugins here
-
- -- Have packer manage itself
-
- use "wbthomason/packer.nvim"
-
- use {
- 'dstein64/vim-startuptime',
- cmd = 'StartupTime',
- config = [[vim.g.startuptime_tries = 3]]
- }
-
- use 'lewis6991/impatient.nvim'
- use 'andweeb/presence.nvim'
- use 'Mofiqul/vscode.nvim' -- vscode theme
-
- use {
- 'tpope/vim-dispatch',
- cmd = {
- 'Dispatch',
- 'Make',
- 'Focus',
- 'Start'
- }
- }
-
- use {
- 'neovim/nvim-lspconfig',
- config = [[require('plugins/lspconfig')]]
- }
-
- use {
- "williamboman/nvim-lsp-installer",
- config = [[require('plugins/lsp-installer')]]
- }
-
- use 'nvim-lua/lsp_extensions.nvim'
- use 'simrat39/rust-tools.nvim'
- use 'simrat39/symbols-outline.nvim'
-
- use {
- "folke/trouble.nvim",
- cmd = "TroubleToggle"
- }
-
- use {
- 'hrsh7th/nvim-cmp',
- requires = {
- { "onsails/lspkind-nvim", config = [[require('plugins/lspkind')]] }, -- vscode-like pictograms for cmp
- 'ray-x/lsp_signature.nvim',
- 'hrsh7th/cmp-nvim-lsp', -- nvim-cmp source for neovim builtin LSP client
- 'hrsh7th/cmp-nvim-lua', -- nvim-cmp source for nvim lua
- 'hrsh7th/cmp-buffer', -- nvim-cmp source for buffer words.
- 'hrsh7th/cmp-path', -- nvim-cmp source for filesystem paths.
- 'hrsh7th/cmp-calc', -- nvim-cmp source for math calculation.
- 'saadparwaiz1/cmp_luasnip', -- luasnip completion source for nvim-cmp
- 'hrsh7th/cmp-nvim-lsp-signature-help', -- luasnip completion source for lsp_signature
- },
- config = [[require('plugins/cmp')]],
- }
-
- use {
- 'nvim-telescope/telescope.nvim',
- requires = {
- 'nvim-lua/plenary.nvim',
- 'BurntSushi/ripgrep',
- 'nvim-telescope/telescope-dap.nvim',
- { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
- { "nvim-telescope/telescope-frecency.nvim", requires = "tami5/sqlite.lua" },
- },
- config = [[require('plugins/telescope')]],
- }
-
- use {
- "jose-elias-alvarez/null-ls.nvim",
- requires = "nvim-lua/plenary.nvim",
- config = [[require('plugins/null-ls')]]
- }
-
- use {
- "L3MON4D3/LuaSnip",
- requires = "rafamadriz/friendly-snippets",
- config = [[require('plugins/luasnip')]]
- }
-
- use {
- "nvim-treesitter/nvim-treesitter",
- run = ":TSUpdate",
- requires = {
- 'nvim-treesitter/nvim-treesitter-refactor',
- 'RRethy/nvim-treesitter-textsubjects',
- },
- config = [[require('plugins/treesitter')]]
- }
-
- use {
- "lukas-reineke/indent-blankline.nvim",
- config = [[require('plugins/blankline')]]
- }
-
- use "tpope/vim-eunuch"
-
- use {
- "nvim-lualine/lualine.nvim",
- requires = {
- { "kyazdani42/nvim-web-devicons" },
- },
- config = [[require('plugins/lualine')]]
- }
-
- use {
- 'tpope/vim-fugitive',
- cmd = {
- 'Git',
- 'Gstatus',
- 'Gblame',
- 'Gpush',
- 'Gpull'
- },
- disable = true
- }
-
- use {
- 'lewis6991/gitsigns.nvim',
- requires = 'nvim-lua/plenary.nvim',
- config = [[require('plugins/gitsigns')]],
- }
-
- use {
- 'TimUntersberger/neogit',
- cmd = 'Neogit',
- config = [[require('neogit').setup {disable_commit_confirmation = true, disable_signs = true}]]
- }
-
- use 'kdheepak/lazygit.nvim'
-
- use {
- "f-person/git-blame.nvim",
- config = [[require('plugins/git-blame')]]
- }
-
- use {
- 'mbbill/undotree',
- cmd = 'UndotreeToggle',
- config = [[vim.g.undotree_SetFocusWhenToggle = 1]],
- }
-
- use {
- "ThePrimeagen/git-worktree.nvim",
- config = [[require('plugins/git-worktree')]]
- }
-
- use {
- 'ThePrimeagen/refactoring.nvim',
- opt = true
- }
-
- use {
- "ahmedkhalf/project.nvim",
- config = [[require('plugins/project')]]
- }
-
- use {
- "folke/which-key.nvim",
- config = [[require('plugins/which-key')]]
- }
-
- use {
- 'mfussenegger/nvim-dap',
- requires = {
- "theHamsta/nvim-dap-virtual-text",
- "rcarriga/nvim-dap-ui",
- "Pocco81/DAPInstall.nvim",
- },
- config = [[require('plugins/dap')]],
- }
-
- use 'rcarriga/nvim-notify'
- use "antoinemadec/FixCursorHold.nvim"
- use "nacro90/numb.nvim"
- use "Shatur/neovim-session-manager"
- use 'ThePrimeagen/harpoon'
- use "b0o/SchemaStore.nvim"
- use 'windwp/nvim-spectre'
-
- use {
- 'goolord/alpha-nvim',
- config = [[require('plugins/alpha')]]
- }
-
- use {
- "filipdutescu/renamer.nvim",
- config = [[require('plugins/renamer')]]
- }
-
- use {
- 'numToStr/Comment.nvim',
- config = [[require('Comment').setup()]]
- }
-
- use {
- 'norcalli/nvim-colorizer.lua',
- ft = {
- 'css',
- 'javascript',
- 'vim',
- 'html'
- },
- config = [[require('colorizer').setup {'css', 'javascript', 'vim', 'html'}]],
- }
-
- use {
- 'akinsho/nvim-bufferline.lua',
- requires = 'kyazdani42/nvim-web-devicons',
- config = [[require('plugins/bufferline')]],
- }
-
- use "moll/vim-bbye"
- use 'SmiteshP/nvim-gps'
-
- use {
- "kyazdani42/nvim-tree.lua",
- requires = {
- {
- 'yamatsum/nvim-nonicons',
- requires = 'kyazdani42/nvim-web-devicons'
- },
- },
- config = [[require('plugins/nvim-tree')]]
- }
-
- -- Automatically set up your configuration after cloning packer.nvim
- -- Put this at the end after all plugins
- if packer_bootstrap then
- require('packer').sync()
- end
+return packer.startup(function(use)
+ -- My plugins here
+
+ -- Have packer manage itself
+
+ use("wbthomason/packer.nvim")
+
+ use({
+ "dstein64/vim-startuptime",
+ cmd = "StartupTime",
+ config = [[vim.g.startuptime_tries = 3]],
+ })
+
+ use("lewis6991/impatient.nvim")
+ use("andweeb/presence.nvim")
+ use("Mofiqul/vscode.nvim") -- vscode theme
+
+ use({
+ "rmagatti/auto-session",
+ config = [[require('auto-session').setup()]],
+ })
+
+ use({
+ "tpope/vim-dispatch",
+ cmd = {
+ "Dispatch",
+ "Make",
+ "Focus",
+ "Start",
+ },
+ })
+
+ use({
+ "neovim/nvim-lspconfig",
+ config = [[require('plugins/lspconfig')]],
+ })
+
+ use({
+ "williamboman/nvim-lsp-installer",
+ config = [[require('plugins/lsp-installer')]],
+ })
+
+ use("nvim-lua/lsp_extensions.nvim")
+ use("simrat39/rust-tools.nvim")
+ use("simrat39/symbols-outline.nvim")
+
+ use({
+ "folke/trouble.nvim",
+ cmd = "TroubleToggle",
+ })
+
+ use({
+ "hrsh7th/nvim-cmp",
+ requires = {
+ { "onsails/lspkind-nvim", config = [[require('plugins/lspkind')]] }, -- vscode-like pictograms for cmp
+ "ray-x/lsp_signature.nvim",
+ "hrsh7th/cmp-nvim-lsp", -- nvim-cmp source for neovim builtin LSP client
+ "hrsh7th/cmp-nvim-lua", -- nvim-cmp source for nvim lua
+ "hrsh7th/cmp-buffer", -- nvim-cmp source for buffer words.
+ "hrsh7th/cmp-path", -- nvim-cmp source for filesystem paths.
+ "hrsh7th/cmp-calc", -- nvim-cmp source for math calculation.
+ "saadparwaiz1/cmp_luasnip", -- luasnip completion source for nvim-cmp
+ "hrsh7th/cmp-nvim-lsp-signature-help", -- luasnip completion source for lsp_signature
+ },
+ config = [[require('plugins/cmp')]],
+ })
+
+ use({
+ "nvim-telescope/telescope.nvim",
+ requires = {
+ "nvim-lua/plenary.nvim",
+ "BurntSushi/ripgrep",
+ "nvim-telescope/telescope-dap.nvim",
+ { "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
+ { "nvim-telescope/telescope-frecency.nvim", requires = "tami5/sqlite.lua" },
+ },
+ config = [[require('plugins/telescope')]],
+ })
+
+ use({
+ "jose-elias-alvarez/null-ls.nvim",
+ requires = "nvim-lua/plenary.nvim",
+ config = [[require('plugins/null-ls')]],
+ })
+
+ use({
+ "L3MON4D3/LuaSnip",
+ requires = "rafamadriz/friendly-snippets",
+ config = [[require('plugins/luasnip')]],
+ })
+
+ use({
+ "nvim-treesitter/nvim-treesitter",
+ run = ":TSUpdate",
+ requires = {
+ "nvim-treesitter/nvim-treesitter-refactor",
+ "RRethy/nvim-treesitter-textsubjects",
+ },
+ config = [[require('plugins/treesitter')]],
+ })
+
+ use({
+ "lukas-reineke/indent-blankline.nvim",
+ config = [[require('plugins/blankline')]],
+ })
+
+ use("tpope/vim-eunuch")
+
+ use({
+ "nvim-lualine/lualine.nvim",
+ requires = {
+ { "kyazdani42/nvim-web-devicons" },
+ },
+ config = [[require('plugins/lualine')]],
+ })
+
+ use({
+ "tpope/vim-fugitive",
+ cmd = {
+ "Git",
+ "Gstatus",
+ "Gblame",
+ "Gpush",
+ "Gpull",
+ },
+ disable = true,
+ })
+
+ use({
+ "lewis6991/gitsigns.nvim",
+ requires = "nvim-lua/plenary.nvim",
+ config = [[require('plugins/gitsigns')]],
+ })
+
+ use({
+ "TimUntersberger/neogit",
+ cmd = "Neogit",
+ config = [[require('neogit').setup {disable_commit_confirmation = true, disable_signs = true}]],
+ })
+
+ use("kdheepak/lazygit.nvim")
+
+ use({
+ "f-person/git-blame.nvim",
+ config = [[require('plugins/git-blame')]],
+ })
+
+ use({
+ "mbbill/undotree",
+ cmd = "UndotreeToggle",
+ config = [[vim.g.undotree_SetFocusWhenToggle = 1]],
+ })
+
+ use({
+ "ThePrimeagen/git-worktree.nvim",
+ config = [[require('plugins/git-worktree')]],
+ })
+
+ use({
+ "ThePrimeagen/refactoring.nvim",
+ opt = true,
+ })
+
+ use({
+ "ahmedkhalf/project.nvim",
+ config = [[require('plugins/project')]],
+ })
+
+ use({
+ "folke/which-key.nvim",
+ config = [[require('plugins/which-key')]],
+ })
+
+ use({
+ "mfussenegger/nvim-dap",
+ requires = {
+ "theHamsta/nvim-dap-virtual-text",
+ "rcarriga/nvim-dap-ui",
+ "Pocco81/DAPInstall.nvim",
+ },
+ config = [[require('plugins/dap')]],
+ })
+
+ use("rcarriga/nvim-notify")
+ use("antoinemadec/FixCursorHold.nvim")
+ use("nacro90/numb.nvim")
+ use("Shatur/neovim-session-manager")
+ use("ThePrimeagen/harpoon")
+ use("b0o/SchemaStore.nvim")
+ use("windwp/nvim-spectre")
+
+ use({
+ "goolord/alpha-nvim",
+ config = [[require('plugins/alpha')]],
+ })
+
+ use({
+ "filipdutescu/renamer.nvim",
+ config = [[require('plugins/renamer')]],
+ })
+
+ use("ur4ltz/surround.nvim")
+
+ use({
+ "numToStr/Comment.nvim",
+ config = [[require('Comment').setup()]],
+ })
+
+ use({
+ "norcalli/nvim-colorizer.lua",
+ ft = {
+ "css",
+ "javascript",
+ "vim",
+ "html",
+ },
+ config = [[require('colorizer').setup {'css', 'javascript', 'vim', 'html'}]],
+ })
+
+ use({
+ "akinsho/nvim-bufferline.lua",
+ requires = "kyazdani42/nvim-web-devicons",
+ config = [[require('plugins/bufferline')]],
+ })
+
+ use("moll/vim-bbye")
+ use("SmiteshP/nvim-gps")
+
+ use({
+ "nvim-neo-tree/neo-tree.nvim",
+ branch = "v2.x",
+ requires = {
+ "nvim-lua/plenary.nvim",
+ "kyazdani42/nvim-web-devicons",
+ "MunifTanjim/nui.nvim",
+ },
+ config = [[require('plugins/neo-tree')]],
+ })
+
+ -- use({
+ -- "kyazdani42/nvim-tree.lua",
+ -- requires = {
+ -- {
+ -- "yamatsum/nvim-nonicons",
+ -- requires = "kyazdani42/nvim-web-devicons",
+ -- },
+ -- },
+ -- config = [[require('plugins/nvim-tree')]],
+ -- })
+
+ -- Automatically set up your configuration after cloning packer.nvim
+ -- Put this at the end after all plugins
+ if packer_bootstrap then
+ require("packer").sync()
+ end
end)
diff --git a/nvim/.config/nvim/lua/plugins/neo-tree.lua b/nvim/.config/nvim/lua/plugins/neo-tree.lua
new file mode 100644
index 0000000..37512d9
--- /dev/null
+++ b/nvim/.config/nvim/lua/plugins/neo-tree.lua
@@ -0,0 +1,73 @@
+local status_ok, neo_tree = pcall(require, "neo-tree")
+if not status_ok then
+ return
+end
+
+vim.cmd([[ let g:neo_tree_remove_legacy_commands = 1 ]])
+
+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" })
+
+neo_tree.setup({
+ close_if_last_window = true,
+ window = {
+ mappings = {
+ ["<space>"] = "none",
+ ["<2-LeftMouse>"] = "none",
+ ["<cr>"] = "none",
+ ["S"] = "none",
+ ["s"] = "none",
+ ["t"] = "none",
+ ["C"] = "none",
+ ["a"] = "none",
+ ["A"] = "none",
+ ["d"] = "none",
+ ["r"] = "none",
+ ["y"] = "none",
+ ["x"] = "none",
+ ["p"] = "none",
+ ["c"] = "none",
+ ["m"] = "none",
+ ["q"] = "none",
+ ["R"] = "none",
+ },
+ },
+ filesystem = {
+ filtered_items = {
+ hide_dotfiles = false,
+ },
+ use_libuv_file_watcher = true,
+ window = {
+ mappings = {
+ ["<bs>"] = "none",
+ ["."] = "none",
+ ["H"] = "none",
+ ["/"] = "none",
+ ["f"] = "none",
+ ["<c-x>"] = "none",
+ },
+ },
+ },
+ buffers = {
+ mappings = {
+ ["bd"] = "none",
+ ["<bs>"] = "none",
+ ["."] = "none",
+ },
+ },
+ git_status = {
+ window = {
+ mappings = {
+ ["A"] = "none",
+ ["gu"] = "none",
+ ["ga"] = "none",
+ ["gr"] = "none",
+ ["gc"] = "none",
+ ["gp"] = "none",
+ ["gg"] = "none",
+ },
+ },
+ },
+})
diff --git a/nvim/.config/nvim/lua/plugins/null-ls.lua b/nvim/.config/nvim/lua/plugins/null-ls.lua
index e3aa45f..5cbaa21 100644
--- a/nvim/.config/nvim/lua/plugins/null-ls.lua
+++ b/nvim/.config/nvim/lua/plugins/null-ls.lua
@@ -8,40 +8,23 @@ local diagnostics = null_ls.builtins.diagnostics
local formatting = null_ls.builtins.formatting
null_ls.setup({
- sources = {
- -- Code Actions
- code_actions.gitsigns,
- -- code_actions.shellcheck,
+ sources = {
+ -- Code Actions
+ code_actions.gitsigns,
+ code_actions.shellcheck,
- -- Diagnostics
- -- diagnostics.codespell,
+ -- Diagnostics
+ -- diagnostics.codespell,
-- diagnostics.luacheck,
-- diagnostics.markdownlint,
- -- diagnostics.shellcheck,
+ diagnostics.shellcheck,
- -- Formatting
- formatting.prettier,
- formatting.black,
- formatting.latexindent,
- formatting.markdownlint,
- formatting.stylua,
- formatting.rustfmt.with({
- extra_args = function(params)
- local Path = require("plenary.path")
- local cargo_toml = Path:new(params.root .. "/" .. "Cargo.toml")
-
- if cargo_toml:exists() and cargo_toml:is_file() then
- for _, line in ipairs(cargo_toml:readlines()) do
- local edition = line:match([[^edition%s*=%s*%"(%d+)%"]])
- if edition then
- return { "--edition=" .. edition }
- end
- end
- end
- -- default edition when we don't find `Cargo.toml` or the `edition` in it.
- return { "--edition=2021" }
- end,
- }),
- formatting.shfmt,
- },
+ -- Formatting
+ formatting.prettier,
+ formatting.black,
+ formatting.latexindent,
+ formatting.markdownlint,
+ formatting.stylua,
+ formatting.shfmt,
+ },
})
diff --git a/nvim/.config/nvim/lua/plugins/which-key.lua b/nvim/.config/nvim/lua/plugins/which-key.lua
index b30fd4d..0886853 100644
--- a/nvim/.config/nvim/lua/plugins/which-key.lua
+++ b/nvim/.config/nvim/lua/plugins/which-key.lua
@@ -31,4 +31,4 @@ local opts = {
nowait = true, -- use `nowait` when creating keymaps
}
-which_key.setup(setup) \ No newline at end of file
+which_key.setup(setup)