From b71f7c2ccea2d4f3dae31310ef4858d3483ec7eb Mon Sep 17 00:00:00 2001 From: Ruslan Date: Sun, 16 Jun 2024 18:55:56 +0300 Subject: [PATCH] add more plugins, change some keybinds --- after/ftplugin/python.lua | 1 + lazy-lock.json | 4 ++++ lua/crentist/lazy/dressing.lua | 4 ++++ lua/crentist/lazy/iconpicker.lua | 12 +++++++++++ lua/crentist/lazy/lsp.lua | 28 +++++++++++++++++++----- lua/crentist/lazy/oil.lua | 9 ++++++++ lua/crentist/lazy/telescope.lua | 28 +++++++++++++++++++++++- lua/crentist/lazy/trouble.lua | 37 ++++++++++++++++++++++++++++++++ lua/crentist/remap.lua | 2 +- 9 files changed, 118 insertions(+), 7 deletions(-) create mode 100644 after/ftplugin/python.lua create mode 100644 lua/crentist/lazy/dressing.lua create mode 100644 lua/crentist/lazy/iconpicker.lua create mode 100644 lua/crentist/lazy/oil.lua create mode 100644 lua/crentist/lazy/trouble.lua diff --git a/after/ftplugin/python.lua b/after/ftplugin/python.lua new file mode 100644 index 0000000..7796897 --- /dev/null +++ b/after/ftplugin/python.lua @@ -0,0 +1 @@ +vim.opt.colorcolumn = "95" diff --git a/lazy-lock.json b/lazy-lock.json index 7e0dbe4..a383ee7 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -6,10 +6,12 @@ "cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" }, "cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" }, "cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" }, + "dressing.nvim": { "branch": "master", "commit": "e3714c8049b2243e792492c4149e4cc395c68eb9" }, "fidget.nvim": { "branch": "main", "commit": "ef99df04a1c53a453602421bc0f756997edc8289" }, "git-blame.nvim": { "branch": "master", "commit": "408d5487d908dfe5d48e5645d8b27ddcc16b11e0" }, "gruvbox.nvim": { "branch": "main", "commit": "d4cde3853a172485961b515c36d51d757728d6e6" }, "harpoon": { "branch": "harpoon2", "commit": "0378a6c428a0bed6a2781d459d7943843f374bce" }, + "icon-picker.nvim": { "branch": "master", "commit": "3ee9a0ea9feeef08ae35e40c8be6a2fa2c20f2d3" }, "indent-blankline.nvim": { "branch": "master", "commit": "d98f537c3492e87b6dc6c2e3f66ac517528f406f" }, "lazy.nvim": { "branch": "main", "commit": "70f2c090d3ffb14f8702d468e05beb240b768881" }, "lualine.nvim": { "branch": "master", "commit": "0a5a66803c7407767b799067986b4dc3036e1983" }, @@ -23,10 +25,12 @@ "nvim-surround": { "branch": "main", "commit": "f1f0699a1d49f28e607ffa4361f1bbe757ac5ebc" }, "nvim-treesitter": { "branch": "master", "commit": "3a74b5831058d0daf8952a5b8c556c61b30a3f46" }, "nvim-web-devicons": { "branch": "master", "commit": "b77921fdc44833c994fdb389d658ccbce5490c16" }, + "oil.nvim": { "branch": "master", "commit": "b77ed915ab1e53720a6283702816cea2695a2638" }, "plenary": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "plenary.nvim": { "branch": "master", "commit": "a3e3bc82a3f95c5ed0d7201546d5d2c19b20d683" }, "search.nvim": { "branch": "main", "commit": "7b8f2315d031be73e14bc2d82386dfac15952614" }, "telescope.nvim": { "branch": "master", "commit": "6312868392331c9c0f22725041f1ec2bef57c751" }, + "trouble.nvim": { "branch": "main", "commit": "60b0ac3772e991bc194207afc28368a5f15d913a" }, "undotree": { "branch": "master", "commit": "56c684a805fe948936cda0d1b19505b84ad7e065" }, "vim-be-good": { "branch": "master", "commit": "4fa57b7957715c91326fcead58c1fa898b9b3625" }, "vim-fugitive": { "branch": "master", "commit": "4f59455d2388e113bd510e85b310d15b9228ca0d" }, diff --git a/lua/crentist/lazy/dressing.lua b/lua/crentist/lazy/dressing.lua new file mode 100644 index 0000000..65d7987 --- /dev/null +++ b/lua/crentist/lazy/dressing.lua @@ -0,0 +1,4 @@ +return { + 'stevearc/dressing.nvim', + opts = {}, +} diff --git a/lua/crentist/lazy/iconpicker.lua b/lua/crentist/lazy/iconpicker.lua new file mode 100644 index 0000000..97c0dab --- /dev/null +++ b/lua/crentist/lazy/iconpicker.lua @@ -0,0 +1,12 @@ +return { + "ziontee113/icon-picker.nvim", + config = function() + require("icon-picker").setup({ disable_legacy_commands = true }) + + local opts = { noremap = true, silent = true } + + vim.keymap.set("n", "i", "IconPickerNormal", opts) + vim.keymap.set("n", "y", "IconPickerYank", opts) --> Yank the selected icon into register + vim.keymap.set("i", "", "IconPickerInsert", opts) + end +} diff --git a/lua/crentist/lazy/lsp.lua b/lua/crentist/lazy/lsp.lua index 36773f2..bebaeb2 100644 --- a/lua/crentist/lazy/lsp.lua +++ b/lua/crentist/lazy/lsp.lua @@ -3,22 +3,26 @@ return { dependencies = { "williamboman/mason.nvim", "williamboman/mason-lspconfig.nvim", + "hrsh7th/nvim-cmp", "hrsh7th/cmp-nvim-lsp", "hrsh7th/cmp-buffer", "hrsh7th/cmp-path", "SergioRibera/cmp-dotenv", "hrsh7th/cmp-cmdline", - "hrsh7th/nvim-cmp", - "L3MON4D3/LuaSnip", "saadparwaiz1/cmp_luasnip", + "L3MON4D3/LuaSnip", "j-hui/fidget.nvim", }, config = function() - local cmp = require('cmp') - local luasnip = require("luasnip") + local augroup = vim.api.nvim_create_augroup + local LspGroup = augroup('Lsp', {}) + local autocmd = vim.api.nvim_create_autocmd - require("fidget").setup({}) + local cmp = require('cmp') + local luasnip = require('luasnip') + + require('fidget').setup({}) require('mason').setup({}) require('mason-lspconfig').setup({ -- Replace the language servers listed here @@ -88,5 +92,19 @@ return { }, }) + + local pythonLineLength = 95 + require('lspconfig').pylsp.setup { + settings = { + pylsp = { + plugins = { + pycodestyle = { + maxLineLength = pythonLineLength + } + } + } + } + } + end } diff --git a/lua/crentist/lazy/oil.lua b/lua/crentist/lazy/oil.lua new file mode 100644 index 0000000..854e186 --- /dev/null +++ b/lua/crentist/lazy/oil.lua @@ -0,0 +1,9 @@ +return { + 'stevearc/oil.nvim', + -- Optional dependencies + dependencies = { "nvim-tree/nvim-web-devicons" }, + opts = {}, + config = function () + require("oil").setup() + end +} diff --git a/lua/crentist/lazy/telescope.lua b/lua/crentist/lazy/telescope.lua index d9c041d..d6cfe6d 100644 --- a/lua/crentist/lazy/telescope.lua +++ b/lua/crentist/lazy/telescope.lua @@ -8,7 +8,25 @@ return { version = "0.1.6", config = function() - require('telescope').setup({}) + local telescope = require('telescope') + local telescopeConfig = require('telescope.config') + + local vimgrep_arguments = { unpack(telescopeConfig.values.vimgrep_arguments) } + table.insert(vimgrep_arguments, "--hidden") + table.insert(vimgrep_arguments, "--glob") + table.insert(vimgrep_arguments, "!**/.git/*") + + telescope.setup({ + defaults = { + vimgrep_arguments = vimgrep_arguments, + }, + pickers = { + find_files = { + find_command = { "rg", "--files", "--hidden", "--glob", "!**/.git/*" }, + } + } + }) + local search = require('search') local builtin = require('telescope.builtin') @@ -17,6 +35,11 @@ return { next = '', prev = '' }, + tabs = { + { name = 'Files', tele_func = builtin.find_files, tele_opts = { no_ignore = true, hidden = true } }, + { name = 'Grep', tele_func = builtin.live_grep }, + { name = 'Buffers', tele_func = builtin.buffers }, + }, append_tabs = { -- append_tabs will add the provided tabs to the default ones { 'Commits', -- or name = "Commits" @@ -29,6 +52,9 @@ return { }) vim.keymap.set('n', 'pf', search.open, {}) + vim.keymap.set('n', 'pb', function() + search.open({ tab_name = 'Buffers' }) + end) vim.keymap.set('n', 'pws', function() local word = vim.fn.expand("") builtin.grep_string({ search = word }) diff --git a/lua/crentist/lazy/trouble.lua b/lua/crentist/lazy/trouble.lua new file mode 100644 index 0000000..46182ac --- /dev/null +++ b/lua/crentist/lazy/trouble.lua @@ -0,0 +1,37 @@ +return { + "folke/trouble.nvim", + opts = {}, -- for default options, refer to the configuration section for custom setup. + cmd = "Trouble", + keys = { + { + "tt", + "Trouble diagnostics toggle", + desc = "Diagnostics (Trouble)", + }, + { + "tT", + "Trouble diagnostics toggle filter.buf=0", + desc = "Buffer Diagnostics (Trouble)", + }, + { + "ts", + "Trouble symbols toggle focus=false", + desc = "Symbols (Trouble)", + }, + { + "tl", + "Trouble lsp toggle focus=false win.position=right", + desc = "LSP Definitions / references / ... (Trouble)", + }, + { + "tL", + "Trouble loclist toggle", + desc = "Location List (Trouble)", + }, + { + "tQ", + "Trouble qflist toggle", + desc = "Quickfix List (Trouble)", + }, + }, +} diff --git a/lua/crentist/remap.lua b/lua/crentist/remap.lua index b111e2d..ae41c79 100644 --- a/lua/crentist/remap.lua +++ b/lua/crentist/remap.lua @@ -1,5 +1,5 @@ vim.g.mapleader = " " -vim.keymap.set("n", "pv", vim.cmd.Ex) +vim.keymap.set("n", "pv", ":Oil .") -- move selected blocks vim.keymap.set("v", "", ":m '>+1gv=gv")