diff --git a/after/plugin/lf.lua b/after/plugin/lf.lua index cef1309..7ff58e9 100644 --- a/after/plugin/lf.lua +++ b/after/plugin/lf.lua @@ -1,8 +1,4 @@ vim.keymap.set("n", "e", function () - vim.g.lf_command_override = string.format('LF_OVERRIDE_X=%d LF_OVERRIDE_Y=%d lf', - math.floor(vim.go.columns * 0.5), - math.ceil(vim.go.lines * 0.25) - ) vim.cmd("Lf") end) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 9ec1ef8..7419405 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -1,64 +1,55 @@ -local lsp = require('lsp-zero') -lsp.preset('recommended') +-- LANGUAGE SERVERS +local lsp_zero = require('lsp-zero') +local lspconfig = require("lspconfig") +local lsp_capabilities = require("cmp_nvim_lsp").default_capabilities() -lsp.ensure_installed({ - "lua_ls", -- Lua - "rust_analyzer", -- Rust - "pyright", -- Python - "texlab", -- Latex - "clangd", -- C - "jdtls", -- Java - "html", -- Html - "bashls", -- Bash -}) +lsp_zero.on_attach(function(client, bufnr) + -- see :help lsp-zero-keybindings + -- to learn the available actions + lsp_zero.default_keymaps({buffer = bufnr}) +end) -local ensure_installed_extras = { -} - -local cmp = require("cmp") -local cmp_select = {behavior = cmp.SelectBehavior.Select} -local cmp_mappings = lsp.defaults.cmp_mappings({ - [""] = cmp.mapping.select_prev_item(cmp_select), - [""] = cmp.mapping.select_next_item(cmp_select), - [""] = cmp.mapping.confirm({ select = true }), -}) - -lsp.set_preferences({ - sign_icons = { } -}) - -lsp.setup_nvim_cmp({ - mapping = cmp_mappings -}) - -lsp.configure('lua_ls', { - settings = { - Lua = { - diagnostics = { - -- Making sure that lua recognizes the global variable 'vim' - globals = { 'vim' }, - }, - }, +lspconfig.lua_ls.setup({ + settings = { + Lua = { + diagnostics = { + -- Making sure that lua recognizes the global variable 'vim' + globals = { 'vim' }, + }, }, + }, }) -lsp.configure('pyright', { - settings = { - python = { - analysis = { - typeCheckingMode = "off", - }, - }, - }, +lspconfig.clangd.setup({ + capabilities = lsp_capabilities, }) -lsp.setup() +-- AUTOCOMPLETION --- Install extra packages (linters, formatters, et c) -local registry = require("mason-registry") -for _, extra in ipairs(ensure_installed_extras) do - if not registry.is_installed(extra) then - vim.cmd(string.format("MasonInstall %s", extra)) - end -end +local cmp = require('cmp') +local cmp_action = require('lsp-zero').cmp_action() + +cmp.setup({ + sources = { + { name = "luasnip", option = { show_autosnippets = true } }, + { name = "nvim_lua" }, + { name = "nvim_lsp" }, + { name = "path" }, -- Auto complete paths + }, + mapping = { + -- Navigate between completion item + [''] = cmp.mapping.select_prev_item(), + [''] = cmp.mapping.select_next_item(), + + -- toggle completion + [''] = cmp_action.toggle_completion(), + + -- navigate between snippet placeholder + [''] = cmp_action.luasnip_jump_backward(), + [''] = cmp_action.luasnip_jump_forward(), + + -- Confirm item + [''] = cmp.mapping.confirm({select = true}), + } +}) diff --git a/after/plugin/neorg.lua b/after/plugin/neorg.lua deleted file mode 100644 index 2d92488..0000000 --- a/after/plugin/neorg.lua +++ /dev/null @@ -1,20 +0,0 @@ -require('neorg').setup { - load = { - ["core.defaults"] = {}, - ["core.concealer"] = {}, - ["core.dirman"] = { - config = { - workspaces = { - notes = "~/dox/norg/notes", - school = "~/school/", - }, - }, - }, - }, -} - -vim.api.nvim_create_autocmd({"BufEnter", "BufWinEnter"}, { - pattern = {"*.norg"}, - command = "set conceallevel=3" -}) - diff --git a/lua/andrew/packer.lua b/lua/andrew/packer.lua index 81ead8c..be78e50 100644 --- a/lua/andrew/packer.lua +++ b/lua/andrew/packer.lua @@ -14,23 +14,17 @@ local packer_bootstrap = ensure_packer() return require("packer").startup(function(use) use "wbthomason/packer.nvim" - -- Org mode - use { - "nvim-neorg/neorg", - run = ":Neorg sync-parsers", - } - - -- Dashboard - use { - 'glepnir/dashboard-nvim', - event = 'VimEnter', - requires = {'nvim-tree/nvim-web-devicons'}, - config = function() - require('dashboard').setup { - -- config - } - end, - } + -- -- Dashboard + -- use { + -- 'glepnir/dashboard-nvim', + -- event = 'VimEnter', + -- requires = {'nvim-tree/nvim-web-devicons'}, + -- config = function() + -- require('dashboard').setup { + -- -- config + -- } + -- end, + -- } -- File manager in nvim use { @@ -43,7 +37,7 @@ return require("packer").startup(function(use) -- Find files and strings use { - "nvim-telescope/telescope.nvim", tag = "0.1.0", + "nvim-telescope/telescope.nvim", tag = "0.1.4", requires = { {"nvim-lua/plenary.nvim"} } } @@ -57,7 +51,7 @@ return require("packer").startup(function(use) use 'Mofiqul/vscode.nvim' -- Referencing a hex code highlights it in that color - use "lilydjwg/colorizer" + use "norcalli/nvim-colorizer.lua" -- Relative line numbers disappear when not actively in buffer use "jeffkreeftmeijer/vim-numbertoggle" @@ -84,20 +78,18 @@ return require("packer").startup(function(use) -- LSP use { 'VonHeikemen/lsp-zero.nvim', - branch = 'v1.x', + branch = 'v3.x', requires = { -- LSP Support - {'neovim/nvim-lspconfig'}, -- Required - {'williamboman/mason.nvim'}, -- Optional - {'williamboman/mason-lspconfig.nvim'}, -- Optional + {'neovim/nvim-lspconfig'}, -- Required -- Autocompletion - {'hrsh7th/nvim-cmp'}, -- Required - {'hrsh7th/cmp-nvim-lsp'}, -- Required - {'hrsh7th/cmp-buffer'}, -- Optional - {'hrsh7th/cmp-path'}, -- Optional - {'saadparwaiz1/cmp_luasnip'}, -- Optional - {'hrsh7th/cmp-nvim-lua'}, -- Optional + {'hrsh7th/nvim-cmp'}, -- Required + {'hrsh7th/cmp-nvim-lsp'}, -- Required + {'hrsh7th/cmp-buffer'}, -- Optional + {'hrsh7th/cmp-path'}, -- Optional + {'saadparwaiz1/cmp_luasnip'}, -- Optional + {'hrsh7th/cmp-nvim-lua'}, -- Optional -- Snippets {'L3MON4D3/LuaSnip'}, -- Required diff --git a/lua/andrew/set.lua b/lua/andrew/set.lua index 63fc9c0..f8c3f48 100644 --- a/lua/andrew/set.lua +++ b/lua/andrew/set.lua @@ -17,6 +17,9 @@ vim.opt.signcolumn = "auto" vim.o.shell = "zsh" +-- Do not map q to :q in man mode +vim.g.no_man_maps = true; + -- Local settings for when in :terminal mode -- I don't believe this functionality has been ported to lua. vim.cmd([[