From 4619fdd80206be4b8b800713beaa96106eb58035 Mon Sep 17 00:00:00 2001 From: Price Hiller Date: Thu, 16 Dec 2021 05:35:15 -0600 Subject: [PATCH] A fuckton of plugins --- lua/lsp.lua | 22 ++++++--- lua/maps.lua | 26 ++++++----- lua/plugins.lua | 94 ++++++++++++++++++++++++++++----------- lua/plugins/lualine.lua | 2 +- lua/plugins/telescope.lua | 38 ---------------- lua/theme.lua | 2 +- 6 files changed, 104 insertions(+), 80 deletions(-) delete mode 100755 lua/plugins/telescope.lua diff --git a/lua/lsp.lua b/lua/lsp.lua index 3ff7036..3f40044 100755 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -1,9 +1,21 @@ +local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " } +for type, icon in pairs(signs) do + local hl = "DiagnosticSign" .. type + vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl }) +end + local lsp_installer = require("nvim-lsp-installer") lsp_installer.on_server_ready(function(server) - local opts = {} - server:setup { - -- capabilities = require("cmp_nvim_lsp").update_capabilities(vim.lsp.protocol.make_client_capabilities()) - capabilities = require("coq").lsp_ensure_capabilities(vim.lsp.protocol.make_client_capabilities()) + local opts = { + capabilities = require("coq").lsp_ensure_capabilities(vim.lsp.protocol.make_client_capabilities()), } - vim.cmd [[ do User LspAttachBuffers ]] + if server.name == "rust_analyzer" then + require("rust-tools").setup{ + server = vim.tbl_deep_extend("force", server:get_default_options(), opts), + } + server:attach_buffers() + else + server:setup(opts) + end end) + diff --git a/lua/maps.lua b/lua/maps.lua index deedb37..10c813c 100755 --- a/lua/maps.lua +++ b/lua/maps.lua @@ -44,17 +44,19 @@ map("n", "bh", "::BufferLineMovePrev") map("n", "nt", ":NvimTreeToggle") --- Telescop. +-- Telescope map("n", "tw", ":Telescope live_grep") map("n", "gs", ":Telescope git_status") map("n", "gc", ":Telescope git_commits") +map("n", "gb", ":Telescope git_branches") map("n", "tf", ":Telescope find_files find_command=rg,--follow,--hidden,--files") map("n", "td", ":Telescope find_directories") map("n", "tp", ":Telescope media_files") map("n", "tb", ":Telescope buffers") map("n", "th", ":Telescope help_tags") map("n", "to", ":Telescope oldfiles") -map("n", "tc", ":Telescope colorscheme") +map("n", "tt", ":Telescope treesitter") +map("n", "tc", ":Telescope neoclip default") -- Dashboard @@ -79,10 +81,10 @@ map("n", "lT", ":lua vim.lsp.buf.type_definition()", lsp_opts) map("n", "ln", ":lua vim.lsp.buf.rename()", lsp_opts) map("n", "lc", ":lua vim.lsp.buf.code_action()", lsp_opts) map("n", "lr", ":lua vim.lsp.buf.references()", lsp_opts) -map("n", "le", ":lua vim.lsp.diagnostic.show_line_diagnostics()", lsp_opts) -map("n", "[d", ":lua vim.lsp.diagnostic.goto_prev()", lsp_opts) -map("n", "]d", ":lua vim.lsp.diagnostic.goto_next()", lsp_opts) -map("n", "lq", ":lua vim.lsp.diagnostic.set_loclist()", lsp_opts) +map("n", "le", ":Telescope diagnostics bufnr=0", lsp_opts) +map("n", "[", ":lua vim.lsp.diagnostic.goto_prev()", lsp_opts) +map("n", "]", ":lua vim.lsp.diagnostic.goto_next()", lsp_opts) +map("n", "lq", ":Telescope diagnostics bufnr=0", lsp_opts) -- Dap @@ -125,10 +127,6 @@ vim.cmd("autocmd! TermOpen term://* lua set_terminal_keymaps()") map("n", "cw", ":StripWhitespace") --- TrueZen focus mode. -map("n", "fs", ":TZFocus") - - -- comment map("n", "/", ":CommentToggle") map("v", "/", ":'<,'>CommentToggle") @@ -136,3 +134,11 @@ map("v", "/", ":'<,'>CommentToggle") -- Code formatter. map("n", "fr", ":Neoformat", lsp_opts) + +-- Searchbox.nvim +map("n", "sf", ":SearchBoxIncSearch") +map("n", "sF", ":SearchBoxIncSearch reverse=true") +map("n", "sr", ":SearchBoxReplace") + +-- Cheatsheet.nvim +map("n", "?", ":Cheatsheet") diff --git a/lua/plugins.lua b/lua/plugins.lua index 35fc95b..6a28b7d 100755 --- a/lua/plugins.lua +++ b/lua/plugins.lua @@ -137,32 +137,39 @@ return require("packer").startup({function() use { "nvim-telescope/telescope-fzf-native.nvim", run = "make", - cmd = "Telescope" } - local os = vim.loop.os_uname().sysname - if os == "Linux" then - use { - "nvim-lua/popup.nvim", - cmd = "Telescope" - } - use { - "nvim-telescope/telescope-media-files.nvim", - cmd = "Telescope" - } - use { - "artart222/telescope_find_directories", - cmd = "Telescope" - } - else - use { - "artart222/telescope_find_directories", - } - end + use { + "nvim-lua/popup.nvim", + } + use { + "nvim-telescope/telescope-media-files.nvim", + } + use { + "artart222/telescope_find_directories", + } use { "nvim-telescope/telescope.nvim", cmd = "Telescope", config = function() - require("plugins/telescope") + local telescope = require("telescope") + + telescope.setup { + extensions = { + media_files = { + filetypes = { "png", "webp", "jpg", "jpeg" }, + find_cmd = "rg" + }, + fzf = { + fuzzy = true, + override_generic_sorter = true, + override_file_sorter = true, + case_mode = "smart_case", + }, + } + } + telescope.load_extension("media_files") + telescope.load_extension("find_directories") + telescope.load_extension("fzf") end } @@ -181,10 +188,7 @@ return require("packer").startup({function() use { "simrat39/rust-tools.nvim", - after = "nvim-lsp-installer", - config = function() - require("rust-tools").setup({}) - end + after = "nvim-lspconfig" } use { "rafamadriz/friendly-snippets", @@ -402,11 +406,51 @@ return require("packer").startup({function() end } + use { + "matze/vim-move" + } + + use { + "stevearc/dressing.nvim" + } + + use { + "VonHeikemen/searchbox.nvim", + requires = { + { "MunifTanjim/nui.nvim" } + } + } + + use { + "sudormrfbin/cheatsheet.nvim", + + requires = { + {"nvim-telescope/telescope.nvim"}, + {"nvim-lua/popup.nvim"}, + {"nvim-lua/plenary.nvim"}, + }, + + config = function() + require("cheatsheet").setup({}) + end + } + + use { + "AckslD/nvim-neoclip.lua", + requires = {"tami5/sqlite.lua", module = "sqlite"}, + config = function() + require("neoclip").setup({ + enable_persistant_history = true, + }) + end, + } + for key, plugin in pairs(additional_plugins) do if type(plugin) == "string" then use { plugin } else use { unpack(plugin) } + select = "" end end diff --git a/lua/plugins/lualine.lua b/lua/plugins/lualine.lua index bc384de..6cc8cdc 100755 --- a/lua/plugins/lualine.lua +++ b/lua/plugins/lualine.lua @@ -34,7 +34,7 @@ local lualine_styles = { lualine.setup { options = { - theme = "spaceduck", + theme = "auto", disabled_filetypes = { "toggleterm", "NvimTree", diff --git a/lua/plugins/telescope.lua b/lua/plugins/telescope.lua deleted file mode 100755 index b598ba4..0000000 --- a/lua/plugins/telescope.lua +++ /dev/null @@ -1,38 +0,0 @@ -local present, telescope = pcall(require, "telescope") -if not present then - return -end - -local os = vim.loop.os_uname().sysname -if os == "Linux" then - telescope.setup { - extensions = { - media_files = { - filetypes = { "png", "webp", "jpg", "jpeg" }, - find_cmd = "rg" - }, - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - }, - }, - } - telescope.load_extension("media_files") - telescope.load_extension("find_directories") - telescope.load_extension("fzf") -else - telescope.setup { - extensions = { - fzf = { - fuzzy = true, - override_generic_sorter = true, - override_file_sorter = true, - case_mode = "smart_case", - } - }, - } - telescope.load_extension("fzf") - telescope.load_extension("find_directories") -end diff --git a/lua/theme.lua b/lua/theme.lua index f35ee73..c6922cd 100755 --- a/lua/theme.lua +++ b/lua/theme.lua @@ -15,7 +15,7 @@ vim.g.onedark_style = "deep" -- styles: dark, darker, cool, deep, warm and w vim.g.enfocado_style = "nature" -- styles: nature and neon. vim.g.neon_style = "dark" vim.g.material_style = "deep ocean" -vim.cmd("colorscheme spaceduck") +vim.cmd("colorscheme tokyonight") function _G.make_codeart_transparent() vim.cmd("highlight Normal guibg=NONE guifg=NONE")