summaryrefslogtreecommitdiffstats
path: root/.config/nvim/lua/plugins
diff options
context:
space:
mode:
authorYigit Sever2023-08-18 23:42:39 +0300
committerYigit Sever2023-08-18 23:42:39 +0300
commit387e08c52d9752bc839c71119f140ba8435c3d70 (patch)
tree3bb20c0e58ccf1e65ced4cfdfb6459e226a24672 /.config/nvim/lua/plugins
parent14c14cfcc9aeb4bada6d2429162ded2917f26a94 (diff)
downloaddotfiles-387e08c52d9752bc839c71119f140ba8435c3d70.tar.gz
dotfiles-387e08c52d9752bc839c71119f140ba8435c3d70.tar.bz2
dotfiles-387e08c52d9752bc839c71119f140ba8435c3d70.zip
nvim: switch to lazy.nvim
revert this as whole, if you miss the good old days
Diffstat (limited to '.config/nvim/lua/plugins')
-rw-r--r--.config/nvim/lua/plugins/barbar.lua77
-rw-r--r--.config/nvim/lua/plugins/cmp.lua114
-rw-r--r--.config/nvim/lua/plugins/colorscheme.lua45
-rw-r--r--.config/nvim/lua/plugins/cutlass.lua51
-rw-r--r--.config/nvim/lua/plugins/dashboard.lua36
-rw-r--r--.config/nvim/lua/plugins/devicons.lua25
-rw-r--r--.config/nvim/lua/plugins/git.lua95
-rw-r--r--.config/nvim/lua/plugins/indent-blankline.lua14
-rw-r--r--.config/nvim/lua/plugins/latex.lua16
-rw-r--r--.config/nvim/lua/plugins/lsp.lua236
-rw-r--r--.config/nvim/lua/plugins/lualine.lua84
-rw-r--r--.config/nvim/lua/plugins/misc.lua83
-rw-r--r--.config/nvim/lua/plugins/nvim-tree.lua40
-rw-r--r--.config/nvim/lua/plugins/telescope.lua45
-rw-r--r--.config/nvim/lua/plugins/tpope.lua11
-rw-r--r--.config/nvim/lua/plugins/treesitter.lua73
-rw-r--r--.config/nvim/lua/plugins/trouble.lua14
-rw-r--r--.config/nvim/lua/plugins/turkish-deasciifier.lua24
-rw-r--r--.config/nvim/lua/plugins/vimwiki.lua28
-rw-r--r--.config/nvim/lua/plugins/which-key.lua14
20 files changed, 1125 insertions, 0 deletions
diff --git a/.config/nvim/lua/plugins/barbar.lua b/.config/nvim/lua/plugins/barbar.lua
new file mode 100644
index 0000000..7b6c69d
--- /dev/null
+++ b/.config/nvim/lua/plugins/barbar.lua
@@ -0,0 +1,77 @@
1return {
2 {
3 "romgrk/barbar.nvim",
4 dependencies = {
5 'lewis6991/gitsigns.nvim',
6 "nvim-tree/nvim-web-devicons"
7 },
8 init = function()
9 vim.g.barbar_auto_setup = false -- disable auto-setup
10 local map = require("helpers.keys").map
11
12 -- move to previous/next
13 map('n', '<A-,>', '<Cmd>BufferPrevious<CR>', "switch to previous buffer")
14 map('n', '<A-.>', '<Cmd>BufferNext<CR>', "switch to next buffer")
15
16 -- re-order to previous/next
17 map('n', '<A-e>', '<Cmd>BufferMovePrevious<CR>', "move buffer back")
18 map('n', '<A-i>', '<Cmd>BufferMoveNext<CR>', "move buffer forward")
19
20 -- goto buffer in position...
21 map('n', '<A-1>', '<Cmd>BufferGoto 1<CR>')
22 map('n', '<A-2>', '<Cmd>BufferGoto 2<CR>')
23 map('n', '<A-3>', '<Cmd>BufferGoto 3<CR>')
24 map('n', '<A-4>', '<Cmd>BufferGoto 4<CR>')
25 map('n', '<A-5>', '<Cmd>BufferGoto 5<CR>')
26 map('n', '<A-6>', '<Cmd>BufferGoto 6<CR>')
27 map('n', '<A-7>', '<Cmd>BufferGoto 7<CR>')
28 map('n', '<A-8>', '<Cmd>BufferGoto 8<CR>')
29 map('n', '<A-9>', '<Cmd>BufferGoto 9<CR>')
30 map('n', '<A-0>', '<Cmd>BufferLast<CR>')
31
32 -- pin/unpin buffer
33 map('n', '<A-p>', '<Cmd>BufferPin<CR>', "pin buffer")
34 -- close buffer
35 map('n', '<A-c>', '<Cmd>BufferClose<CR>', "close buffer")
36 -- magic buffer-picking mode
37 map('n', '<leader>dg', '<Cmd>BufferPick<CR>', "buffer picking mode")
38 -- sort automatically by...
39 map('n', '<Leader>db', '<Cmd>BufferOrderByBufferNumber<CR>', "sort buffers by number")
40 map('n', '<Leader>dd', '<Cmd>BufferOrderByDirectory<CR>', "sort buffers by directory")
41 map('n', '<Leader>dl', '<Cmd>BufferOrderByLanguage<CR>', "sort buffers by language")
42 map('n', '<Leader>dw', '<Cmd>BufferOrderByWindowNumber<CR>', "sort buffers by window number")
43 end,
44 opts = {
45 animation = false,
46 auto_hide = true,
47 tabpages = true,
48 closable = true,
49 clickable = false,
50 icons = {
51 diagnostics = {
52 [vim.diagnostic.severity.ERROR] = {enabled = true, icon = '❌'},
53 [vim.diagnostic.severity.WARN] = {enabled = false},
54 [vim.diagnostic.severity.INFO] = {enabled = false},
55 [vim.diagnostic.severity.HINT] = {enabled = true},
56 },
57 filetype = {
58 custom_colors = false,
59 enabled = true,
60 },
61 separator = { left = '▎', right = ''},
62 modified = { button = ''},
63 pinned = { button = '', filename = true, separator = { right = ''}},
64 },
65
66 insert_at_end = false,
67 insert_at_start = false,
68
69 maximum_padding = 1,
70 minimum_padding = 1,
71 maximum_length = 30,
72 semantic_letters = true,
73 letters = 'arstneoidhqwfpluy;zxcvkmARSTNEOIDHQWFPLUYZXCVKM',
74 no_name_title = nil,
75 },
76 },
77}
diff --git a/.config/nvim/lua/plugins/cmp.lua b/.config/nvim/lua/plugins/cmp.lua
new file mode 100644
index 0000000..78ff9a9
--- /dev/null
+++ b/.config/nvim/lua/plugins/cmp.lua
@@ -0,0 +1,114 @@
1-- autocompletion
2return {
3 {
4 "hrsh7th/nvim-cmp",
5 event = "InsertEnter",
6 dependencies = {
7 "hrsh7th/cmp-nvim-lsp",
8 "hrsh7th/cmp-nvim-lua",
9 "hrsh7th/cmp-buffer",
10 "hrsh7th/cmp-path",
11 "L3MON4D3/LuaSnip",
12 "saadparwaiz1/cmp_luasnip",
13 "rafamadriz/friendly-snippets",
14 },
15 config = function()
16 local cmp = require("cmp")
17 local luasnip = require("luasnip")
18
19 require("luasnip/loaders/from_vscode").lazy_load()
20
21 local kind_icons = {
22 Text = "󰊄",
23 Method = "m",
24 Function = "󰊕",
25 Constructor = "",
26 Field = "󰽏",
27 Variable = "󰫧",
28 Class = "󰌗",
29 Interface = "",
30 Module = "",
31 Property = "",
32 Unit = "",
33 Value = "󰎠",
34 Enum = "",
35 Keyword = "",
36 Snippet = "",
37 Color = "󰏘",
38 File = "󰈙",
39 Reference = "",
40 Folder = "󰉋",
41 EnumMember = "",
42 Constant = "󰇽",
43 Struct = "",
44 Event = "",
45 Operator = "󰆕",
46 TypeParameter = "",
47 }
48
49 cmp.setup({
50 enabled = true,
51 snippet = {
52 expand = function(args)
53 luasnip.lsp_expand(args.body)
54 end,
55 },
56 mapping = cmp.mapping.preset.insert({
57 ["<C-k>"] = cmp.mapping.select_prev_item(),
58 ["<C-j>"] = cmp.mapping.select_next_item(),
59 ["<C-d>"] = cmp.mapping.scroll_docs(-4),
60 ["<C-f>"] = cmp.mapping.scroll_docs(4),
61 ["<CR>"] = cmp.mapping.confirm({
62 behavior = cmp.ConfirmBehavior.Replace,
63 select = false,
64 }),
65 ["<Tab>"] = cmp.mapping(function(fallback)
66 if cmp.visible() then
67 cmp.select_next_item()
68 elseif luasnip.expand_or_jumpable() then
69 luasnip.expand_or_jump()
70 else
71 fallback()
72 end
73 end, { "i", "s" }),
74 ["<S-Tab>"] = cmp.mapping(function(fallback)
75 if cmp.visible() then
76 cmp.select_prev_item()
77 elseif luasnip.jumpable(-1) then
78 luasnip.jump(-1)
79 else
80 fallback()
81 end
82 end, { "i", "s" }),
83 }),
84 formatting = {
85 fields = { "kind", "abbr", "menu" },
86 format = function(entry, vim_item)
87 -- kind icons
88 vim_item.kind = string.format("%s", kind_icons[vim_item.kind])
89 vim_item.menu = ({
90 nvim_lsp = "[lsp]",
91 luasnip = "[snippet]",
92 buffer = "[buffer]",
93 path = "[path]",
94 })[entry.source.name]
95 return vim_item
96 end,
97 },
98 sources = {
99 { name = "nvim_lsp" },
100 { name = "luasnip" },
101 { name = "buffer" },
102 { name = "path" },
103 },
104 })
105
106 -- If you want insert `(` after select function or method item
107 local cmp_autopairs = require('nvim-autopairs.completion.cmp')
108 cmp.event:on(
109 'confirm_done',
110 cmp_autopairs.on_confirm_done()
111 )
112 end,
113 },
114}
diff --git a/.config/nvim/lua/plugins/colorscheme.lua b/.config/nvim/lua/plugins/colorscheme.lua
new file mode 100644
index 0000000..969d304
--- /dev/null
+++ b/.config/nvim/lua/plugins/colorscheme.lua
@@ -0,0 +1,45 @@
1return {
2 {
3 "catppuccin/nvim",
4 name = "catppuccin",
5 lazy = false,
6 priority = 1000,
7 config = function()
8 require("catppuccin").setup({
9 flavour = "mocha", -- latte, frappe, macchiato, mocha
10 background = {
11 light = "latte",
12 dark = "mocha",
13 },
14 transparent_background = false,
15 term_colors = false,
16 no_italic = true, -- force no italic
17 no_bold = false, -- force no bold
18 integrations = {
19 barbar = true,
20 cmp = true,
21 fidget = true,
22 gitsigns = true,
23 leap = true,
24 nvimtree = true,
25 telescope = true,
26 treesitter = true,
27 vimwiki = true,
28 },
29 native_lsp = {
30 enabled = true,
31 underlines = {
32 errors = { "underline" },
33 hints = { "underline" },
34 warnings = { "underline" },
35 information = { "underline" },
36 },
37 },
38 indent_blankline = {
39 enabled = true,
40 },
41 })
42 vim.cmd("colorscheme catppuccin")
43 end,
44 },
45}
diff --git a/.config/nvim/lua/plugins/cutlass.lua b/.config/nvim/lua/plugins/cutlass.lua
new file mode 100644
index 0000000..0b8ef52
--- /dev/null
+++ b/.config/nvim/lua/plugins/cutlass.lua
@@ -0,0 +1,51 @@
1return {
2 {
3 'svermeulen/vim-cutlass',
4 },
5 {
6 'svermeulen/vim-subversive',
7 config = function()
8 local map = require("helpers.keys").map
9
10 -- substitute from yank
11 map('n', '<Leader>ys', '<plug>(SubversiveSubstitute)', "substitute from yank")
12 map('n', '<Leader>yss', '<plug>(SubversiveSubstituteLine)', "substitute from yank, line")
13 map('n', '<Leader>yS', '<plug>(SubversiveSubstituteToEndOfLine)', "substitute from yank, eol")
14
15 -- substitute over range
16 map( { 'n', 'x' }, '<Leader>s', '<plug>(SubversiveSubstituteRange)', "start substitude over range")
17 map('n', '<Leader>ss', '<plug>(SubversiveSubstituteWordRange)', "start substitude over range")
18 end
19 },
20 {
21 'svermeulen/vim-yoink',
22 config = function()
23 vim.g.yoinkIncludeDeleteOperations = 1
24
25 -- fix the Target STRING not available
26 vim.g.clipboard = {
27 name = 'xsel_override',
28 copy = {
29 ['+'] = 'xsel --input --clipboard',
30 ['*'] = 'xsel --input --primary',
31 },
32 paste = {
33 ['+'] = 'xsel --output --clipboard',
34 ['*'] = 'xsel --output --primary',
35 },
36 cache_enabled = 1,
37 }
38
39 local map = require("helpers.keys").map
40
41 -- yoink paste
42 map('n', 'p', '<Plug>(YoinkPaste_p)')
43 map('n', 'P', '<Plug>(YoinkPaste_P)')
44
45 -- iterate over yank list
46 map('n', '<c-n>', '<Plug>(YoinkPostPasteSwapBack)')
47 map('n', '<c-p>', '<Plug>(YoinkPostPasteSwapForward)')
48
49 end,
50 }
51}
diff --git a/.config/nvim/lua/plugins/dashboard.lua b/.config/nvim/lua/plugins/dashboard.lua
new file mode 100644
index 0000000..074d3f5
--- /dev/null
+++ b/.config/nvim/lua/plugins/dashboard.lua
@@ -0,0 +1,36 @@
1return {
2 {
3 'glepnir/dashboard-nvim',
4 event = 'VimEnter',
5 config = function()
6 require('dashboard').setup {
7 theme = 'hyper',
8 change_to_vcs_root = true,
9 config = {
10 week_header = {
11 enable = true,
12 },
13 shortcut = {
14 {
15 desc = '󰊳 Update', group = '@property', action = 'Lazy update', key = 'u',
16 },
17 {
18 icon = ' ',
19 icon_hl = '@variable',
20 desc = 'Files',
21 group = 'Label',
22 action = 'Telescope find_files',
23 key = 'f',
24 },
25 },
26 },
27
28 }
29 end,
30 dependencies = {
31 {
32 'nvim-tree/nvim-web-devicons'
33 }
34 }
35 }
36}
diff --git a/.config/nvim/lua/plugins/devicons.lua b/.config/nvim/lua/plugins/devicons.lua
new file mode 100644
index 0000000..712ecc6
--- /dev/null
+++ b/.config/nvim/lua/plugins/devicons.lua
@@ -0,0 +1,25 @@
1return {
2 {
3 "nvim-tree/nvim-web-devicons",
4 opts = {
5 override = {
6 wiki = {
7 icon = "󰂺",
8 color = "#D7827E",
9 name = "vimwiki"
10 },
11 rem = {
12 icon = " ",
13 color = "#B4637A",
14 name = "remind"
15 },
16 mail = {
17 icon = "󰇰 ",
18 color = "#907AA9",
19 name = "mail"
20 },
21 },
22 default = true
23 },
24 },
25}
diff --git a/.config/nvim/lua/plugins/git.lua b/.config/nvim/lua/plugins/git.lua
new file mode 100644
index 0000000..0e4d7f5
--- /dev/null
+++ b/.config/nvim/lua/plugins/git.lua
@@ -0,0 +1,95 @@
1return {
2 {
3 "lewis6991/gitsigns.nvim",
4 opts = {
5 signs = {
6 add = { text = '│' },
7 change = { text = '│' },
8 delete = { text = '_' },
9 topdelete = { text = '‾' },
10 changedelete = { text = '~' },
11 untracked = { text = '┆' },
12 },
13 signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
14 numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
15 linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
16 word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
17 watch_gitdir = {
18 follow_files = true
19 },
20 attach_to_untracked = true,
21 current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
22 current_line_blame_opts = {
23 virt_text = true,
24 virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
25 delay = 1000,
26 ignore_whitespace = false,
27 },
28 current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
29 sign_priority = 6,
30 update_debounce = 100,
31 status_formatter = nil, -- Use default
32 max_file_length = 40000, -- Disable if file is longer than this (in lines)
33 preview_config = {
34 -- Options passed to nvim_open_win
35 border = 'single',
36 style = 'minimal',
37 relative = 'cursor',
38 row = 0,
39 col = 1
40 },
41 yadm = {
42 enable = true
43 },
44
45 on_attach = function(bufnr)
46 local gs = package.loaded.gitsigns
47
48 local function map(mode, l, r, desc, opts)
49 opts = opts or {}
50 opts.buffer = bufnr
51 opts.desc = desc
52 vim.keymap.set(mode, l, r, opts)
53 end
54
55 -- navigation
56 map('n', ']c', function()
57 if vim.wo.diff then return ']c' end
58 vim.schedule(function() gs.next_hunk() end)
59 return '<Ignore>'
60 end, "jump to next hunk", { expr = true })
61
62 map('n', '[c', function()
63 if vim.wo.diff then return '[c' end
64 vim.schedule(function() gs.prev_hunk() end)
65 return '<Ignore>'
66 end, "jump to previous hunk", { expr = true })
67
68 -- Actions
69 map('n', '<leader>hs', gs.stage_hunk, "stage hunk")
70 map('n', '<leader>hr', gs.reset_hunk, "reset hunk")
71 map('v', '<leader>hs', function() gs.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end,
72 "stage selection")
73 map('v', '<leader>hr', function() gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end,
74 "reset selection")
75 map('n', '<leader>hS', gs.stage_buffer, "stage buffer")
76 map('n', '<leader>hu', gs.undo_stage_hunk, "undo stage hunk")
77 map('n', '<leader>hR', gs.reset_buffer, "undo reset buffer")
78 map('n', '<leader>hp', gs.preview_hunk, "preview hunk")
79 map('n', '<leader>hb', function() gs.blame_line { full = true } end, "blame line")
80 map('n', '<leader>tb', gs.toggle_current_line_blame, "toggle current line blame")
81 map('n', '<leader>hd', gs.diffthis, "diff this")
82 map('n', '<leader>hD', function() gs.diffthis('~') end, "diff whole buffer")
83 map('n', '<leader>td', gs.toggle_deleted, "toggle deleted")
84
85 -- Text object
86 map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', "select hunk")
87 end
88
89 },
90 },
91 {
92 "tpope/vim-fugitive",
93 cmd = { 'Git', 'Gstatus', 'Gblame', 'Gpush', 'Gpull' },
94 },
95}
diff --git a/.config/nvim/lua/plugins/indent-blankline.lua b/.config/nvim/lua/plugins/indent-blankline.lua
new file mode 100644
index 0000000..42e5c62
--- /dev/null
+++ b/.config/nvim/lua/plugins/indent-blankline.lua
@@ -0,0 +1,14 @@
1return {
2 {
3 "lukas-reineke/indent-blankline.nvim",
4 init = function()
5 vim.opt.list = true
6 end,
7 config = {
8 show_current_context = true,
9 char = "┊",
10 buftype_exclude = {"terminal"},
11 filetype_exclude = {"dashboard", "help", "man"}
12 },
13 },
14}
diff --git a/.config/nvim/lua/plugins/latex.lua b/.config/nvim/lua/plugins/latex.lua
new file mode 100644
index 0000000..8582c6f
--- /dev/null
+++ b/.config/nvim/lua/plugins/latex.lua
@@ -0,0 +1,16 @@
1return {
2 {
3 "lervag/vimtex",
4 ft = { 'tex', 'latex', 'plaintext' },
5 init = function()
6 vim.g.vimtex_view_method = 'zathura'
7 vim.g.vimtex_quickfix_mode = 0
8 vim.g.vimtex_quickfix_ignore_filters = {"Underfull", "Overfull"}
9 vim.g.vimtex_compiler_latexmk = {
10 options = {
11 "-pdf", '-shell-escape', '-verbose', '-file-line-error', '-synctex=1', '-interaction=nonstopmode'
12 }
13 }
14 end,
15 },
16}
diff --git a/.config/nvim/lua/plugins/lsp.lua b/.config/nvim/lua/plugins/lsp.lua
new file mode 100644
index 0000000..d03d9af
--- /dev/null
+++ b/.config/nvim/lua/plugins/lsp.lua
@@ -0,0 +1,236 @@
1return {
2 {
3 "neovim/nvim-lspconfig",
4 dependencies = {
5 "williamboman/mason.nvim",
6 "williamboman/mason-lspconfig.nvim",
7 "j-hui/fidget.nvim",
8 "folke/neodev.nvim",
9 "RRethy/vim-illuminate",
10 "hrsh7th/cmp-nvim-lsp",
11 },
12 config = function()
13 local map = require("helpers.keys").map
14
15 map('n', '<leader>e', vim.diagnostic.open_float, "lsp: open diagnostics float")
16 map('n', '[d', vim.diagnostic.goto_prev, "lsp: goto previous diagnostic")
17 map('n', ']d', vim.diagnostic.goto_next, "lsp: goto next diagnostic")
18
19 -- set up mason before anything else
20 require("mason").setup()
21 require("mason-lspconfig").setup({
22 ensure_installed = {
23 "lua_ls",
24 "pylsp",
25 },
26 automatic_installation = true,
27 })
28
29 -- quick access via keymap
30 require("helpers.keys").map("n", "<leader>M", "<cmd>Mason<cr>", "show mason")
31
32 -- neodev setup before lsp config
33 require("neodev").setup()
34
35 -- set up cool signs for diagnostics
36 local signs = { Error = " ", Warn = "", Hint = "", Info = "" }
37 for type, icon in pairs(signs) do
38 local hl = "DiagnosticSign" .. type
39 vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = "" })
40 end
41
42 -- Diagnostic config
43 local config = {
44 virtual_text = false,
45 signs = {
46 active = signs,
47 },
48 update_in_insert = true,
49 underline = true,
50 severity_sort = true,
51 float = {
52 focusable = true,
53 style = "minimal",
54 border = "rounded",
55 source = "always",
56 header = "",
57 prefix = "",
58 },
59 }
60 vim.diagnostic.config(config)
61
62 -- this function gets run when an lsp connects to a particular buffer.
63 local on_attach = function(client, bufnr)
64 map = require("helpers.keys").lsp_map
65
66 map("<leader>lr", vim.lsp.buf.rename, bufnr, "lsp: rename symbol")
67 map("<leader>la", vim.lsp.buf.code_action, bufnr, "lsp: code action")
68 map("<leader>ld", vim.lsp.buf.type_definition, bufnr, "lsp: type definition")
69 map("<leader>ls", require("telescope.builtin").lsp_document_symbols, bufnr, "lsp: document symbols")
70
71 map("gd", vim.lsp.buf.definition, bufnr, "lsp: goto definition")
72 map("gD", vim.lsp.buf.declaration, bufnr, "lsp: goto declaration")
73 map("gr", require("telescope.builtin").lsp_references, bufnr, "lsp: goto references")
74 map("gI", vim.lsp.buf.implementation, bufnr, "lsp: goto implementation")
75 map("K", vim.lsp.buf.hover, bufnr, "lsp: hover documentation")
76 map("<c-k>", vim.lsp.buf.signature_help, bufnr, "lsp: signature help")
77
78 -- Create a command `:Format` local to the LSP buffer
79 vim.api.nvim_buf_create_user_command(bufnr, "Format", function(_)
80 vim.lsp.buf.format()
81 end, { desc = "lsp: format current buffer" })
82
83 map("<leader>fm", "<cmd>Format<cr>", bufnr, "lsp: format current buffer")
84
85 -- Attach and configure vim-illuminate
86 -- apparently this is deprecated
87 -- https://github.com/RRethy/vim-illuminate/issues/111
88 require("illuminate").on_attach(client)
89 end
90
91 -- nvim-cmp supports additional completion capabilities, so broadcast that to servers
92 local capabilities = vim.lsp.protocol.make_client_capabilities()
93 capabilities = require("cmp_nvim_lsp").default_capabilities(capabilities)
94
95 -- lua
96 require("lspconfig")["lua_ls"].setup({
97 on_attach = on_attach,
98 capabilities = capabilities,
99 settings = {
100 Lua = {
101 completion = {
102 callSnippet = "Replace",
103 },
104 diagnostics = {
105 globals = { "vim" },
106 },
107 workspace = {
108 library = {
109 [vim.fn.expand("$VIMRUNTIME/lua")] = true,
110 [vim.fn.stdpath("config") .. "/lua"] = true,
111 },
112 },
113 },
114 },
115 })
116
117 -- python
118 require("lspconfig")["pylsp"].setup({
119 on_attach = on_attach,
120 capabilities = capabilities,
121 settings = {
122 pylsp = {
123 plugins = {
124 flake8 = {
125 enabled = true,
126 maxLineLength = 88, -- black's line length
127 },
128 -- disable plugins overlapping with flake8
129 pycodestyle = {
130 enabled = false,
131 },
132 mccabe = {
133 enabled = false,
134 },
135 pyflakes = {
136 enabled = false,
137 },
138 -- use black as the formatter
139 autopep8 = {
140 enabled = false,
141 },
142 },
143 },
144 },
145 })
146
147 -- efm
148 require("lspconfig")["efm"].setup({
149 on_attach = on_attach,
150 filetypes = { 'sh' },
151 capabilities = capabilities
152 })
153
154 -- ltex
155 require("lspconfig")["ltex"].setup({
156 capabilities = capabilities,
157 on_attach = function(client, bufnr)
158 on_attach(client, bufnr)
159 require("ltex_extra").setup {
160 load_langs = { "en-GB" },
161 init_check = true,
162 log_level = "none",
163 }
164 end,
165 settings = {
166 ltex = {
167 -- my settings here
168 }
169 }
170 })
171
172 -- rust-tools
173 local rust_opts = {
174 tools = {
175 runnables = {
176 use_telescope = true,
177 },
178 inlay_hints = {
179 auto = true,
180 show_parameter_hints = true,
181 parameter_hints_prefix = "↸ ",
182 other_hints_prefix = "❱ ",
183 },
184 },
185
186 -- all the opts to send to nvim-lspconfig
187 -- these override the defaults set by rust-tools.nvim
188 -- see https://github.com/neovim/nvim-lspconfig/blob/master/CONFIG.md#rust_analyzer
189 server = {
190 on_attach = on_attach,
191 settings = {
192 -- to enable rust-analyzer settings visit:
193 -- https://github.com/rust-analyzer/rust-analyzer/blob/master/docs/user/generated_config.adoc
194 ["rust-analyzer"] = {
195 -- enable clippy on save
196 checkOnSave = {
197 command = "clippy",
198 },
199 },
200 },
201 },
202 }
203
204 require('rust-tools').setup(rust_opts)
205 end,
206 },
207 {
208 "barreiroleo/ltex-extra.nvim",
209 event = "LspAttach",
210 },
211 {
212 "j-hui/fidget.nvim",
213 tag = "legacy",
214 event = "LspAttach",
215 opts = {
216 text = {
217 spinner = "triangle",
218 commenced = "started", -- message shown when task starts
219 completed = "done", -- message shown when task completes
220 },
221 },
222 },
223 {
224 "simrat39/rust-tools.nvim",
225 event = "LspAttach",
226 },
227 -- {
228 -- "RRethy/vim-illuminate",
229 -- opts = {
230 -- filetypes_denylist = {
231 -- 'NvimTree',
232 -- 'fugitive',
233 -- },
234 -- },
235 -- },
236}
diff --git a/.config/nvim/lua/plugins/lualine.lua b/.config/nvim/lua/plugins/lualine.lua
new file mode 100644
index 0000000..c528b69
--- /dev/null
+++ b/.config/nvim/lua/plugins/lualine.lua
@@ -0,0 +1,84 @@
1return {
2 "nvim-lualine/lualine.nvim",
3 dependencies = {
4 "nvim-tree/nvim-web-devicons"
5 },
6 config = function()
7 local function lualine_spell()
8 if vim.wo.spell then
9 return "spell"
10 else
11 return
12 end
13 end
14
15 local conditions = {
16 spell_on = function ()
17 return vim.wo.spell
18 end,
19 filetype_is_tex = function()
20 return vim.bo.filetype == "tex"
21 end
22 }
23
24 -- https://www.reddit.com/r/neovim/comments/u2uc4p/your_lualine_custom_features/i4muvp6/
25 -- override 'encoding': don't display if encoding is utf-8.
26 local encoding = function()
27 local ret, _ = vim.bo.fenc:gsub("^utf%-8$", "")
28 return ret
29 end
30
31 -- fileformat: don't display if &ff is unix.
32 local fileformat = function()
33 local ret, _ = vim.bo.fileformat:gsub("^unix$", "")
34 return ret
35 end
36
37 require("lualine").setup({
38 options = {
39 icons_enabled = true,
40 theme = "catppuccin",
41 section_separators = { left = '', right = '' },
42 component_separators = { left = '', right = '' },
43 },
44 sections = {
45 lualine_a = {{'mode', fmt = string.lower}},
46 lualine_b = {'branch',
47 {
48 'diff',
49 diff_color= {
50 added = { fg = 'LightGreen' },
51 modified = { fg = 'LightBlue' },
52 removed = { fg = 'LightRed' },
53 }
54 },
55 {
56 lualine_spell,
57 cond = conditions.spell_on,
58 }},
59 lualine_c = {'filename'},
60 lualine_x = {encoding, fileformat, 'filetype'},
61 lualine_y = {'progress'},
62 lualine_z = {
63 'location', {
64 'diagnostics',
65 sources = {'nvim_diagnostic'},
66 sections = {'error', 'warn', 'info', 'hint'},
67 symbols = {error = 'e', warn = 'w', info = 'i', hint = 'h'}
68 }
69 }
70 },
71 inactive_sections = {
72 lualine_a = {},
73 lualine_b = {},
74 lualine_c = {'filename'},
75 lualine_x = {},
76 lualine_y = {},
77 lualine_z = {}
78 },
79 tabline = {},
80 extensions = {}
81
82 })
83 end,
84}
diff --git a/.config/nvim/lua/plugins/misc.lua b/.config/nvim/lua/plugins/misc.lua
new file mode 100644
index 0000000..f99051e
--- /dev/null
+++ b/.config/nvim/lua/plugins/misc.lua
@@ -0,0 +1,83 @@
1return {
2 {
3 "numToStr/Comment.nvim",
4 lazy = false,
5 opts = {},
6 },
7 {
8 "godlygeek/tabular",
9 lazy = false,
10 },
11 {
12 "matze/vim-move"
13 },
14 {
15 "ggandor/leap.nvim",
16 lazy = false,
17 init = function()
18 local map = require("helpers.keys").map
19
20 map({ "n", "v" }, '`', '<Plug>(leap-forward)', "leap forward")
21 map({ "n", "v" }, '<Leader>`', '<Plug>(leap-backward)', "leap backward")
22 end,
23 opts = {
24 case_insensitive = true,
25 substitute_chars = { ['\r'] = '¬' }
26 }
27 },
28 {
29 "wellle/targets.vim"
30 },
31 {
32 "monaqa/dial.nvim",
33 init = function()
34 local augend = require("dial.augend")
35 require("dial.config").augends:register_group {
36 -- default augends used when no group name is specified
37 default = {
38 augend.integer.alias.decimal, -- nonnegative decimal number (0, 1, 2, 3, ...)
39 augend.integer.alias.hex, -- nonnegative hex number (0x01, 0x1a1f, etc.)
40 augend.date.alias["%Y/%m/%d"], -- date (2022/02/19, etc.)
41 augend.date.alias["%Y-%m-%d"],
42 augend.semver.alias.semver,
43 augend.constant.new {
44 elements = { "and", "or" },
45 word = true, -- if false, "sand" is incremented into "sor", "doctor" into "doctand", etc.
46 cyclic = true, -- "or" is incremented into "and".
47 },
48 augend.constant.new {
49 elements = { "&&", "||" },
50 word = false,
51 cyclic = true,
52 },
53 },
54 }
55 local map = require("helpers.keys").map
56 map("n", "<C-a>", require("dial.map").inc_normal(), "dial: increment")
57 map("n", "<C-x>", require("dial.map").dec_normal(), "dial: decrement")
58 map("v", "<C-a>", require("dial.map").inc_visual(), "dial: visual increment")
59 map("v", "<C-x>", require("dial.map").dec_visual(), "dial: visual decrement")
60 end,
61 },
62 {
63 "kylechui/nvim-surround",
64 version = "*", -- Use for stability; omit to use `main` branch for the latest features
65 event = "VeryLazy",
66 config = function()
67 require("nvim-surround").setup({})
68 end
69 },
70 {
71 "windwp/nvim-autopairs",
72 event = "InsertEnter",
73 opts = {
74 disable_filetype = { "TelescopePrompt" },
75 },
76 init = function()
77 local Rule = require('nvim-autopairs.rule')
78 local npairs = require('nvim-autopairs')
79
80 npairs.add_rule(Rule('%"', '%"', "remind"))
81 end
82 },
83}
diff --git a/.config/nvim/lua/plugins/nvim-tree.lua b/.config/nvim/lua/plugins/nvim-tree.lua
new file mode 100644
index 0000000..a2d4532
--- /dev/null
+++ b/.config/nvim/lua/plugins/nvim-tree.lua
@@ -0,0 +1,40 @@
1return {
2 {
3 "nvim-tree/nvim-tree.lua",
4 lazy = false,
5 dependencies = {
6 "nvim-tree/nvim-web-devicons",
7 },
8 opts = {
9 sort_by = "case_sensitive",
10 diagnostics = {
11 enable = false,
12 icons = {
13 hint = "❔",
14 info = "❕",
15 warning = "❗",
16 error = "❌",
17 }
18 },
19 view = {
20 adaptive_size = true,
21 },
22 renderer = {
23 group_empty = true,
24 },
25 filters = {
26 dotfiles = true,
27 },
28 },
29 init = function()
30 vim.g.loaded_netrw = 1
31 vim.g.loaded_netrwPlugin = 1
32
33 local map = require("helpers.keys").map
34
35 map("n", "vt", "<cmd>NvimTreeToggle<cr>")
36 map("n", "vr", "<cmd>NvimTreeRefresh<cr>")
37 map("n", "vs", "<cmd>NvimTreeFindFile<cr>")
38 end,
39 },
40}
diff --git a/.config/nvim/lua/plugins/telescope.lua b/.config/nvim/lua/plugins/telescope.lua
new file mode 100644
index 0000000..ecea32b
--- /dev/null
+++ b/.config/nvim/lua/plugins/telescope.lua
@@ -0,0 +1,45 @@
1return {
2 {
3 "nvim-telescope/telescope.nvim",
4 dependencies = {
5 "nvim-lua/plenary.nvim",
6 {
7 "nvim-telescope/telescope-fzf-native.nvim",
8 build = "make",
9 cond = vim.fn.executable("make") == 1
10 },
11 },
12 config = function()
13 require('telescope').setup({
14 extensions = {
15 fzf = {
16 fuzzy = true, -- false will only do exact matching
17 override_generic_sorter = true,
18 override_file_sorter = true,
19 case_mode = "smart_case",
20 }
21 }
22 })
23 -- Enable telescope fzf native, if installed
24 pcall(require("telescope").load_extension, "fzf")
25
26 local map = require("helpers.keys").map
27
28 map("n", "<leader>fr", require("telescope.builtin").oldfiles, "recently opened")
29 map("n", "<leader><space>", require("telescope.builtin").buffers, "open buffers")
30 map("n", "<leader>/", function()
31 -- You can pass additional configuration to telescope to change theme, layout, etc.
32 require("telescope.builtin").current_buffer_fuzzy_find(require("telescope.themes").get_dropdown({
33 winblend = 10,
34 previewer = false,
35 }))
36 end, "search in current buffer")
37
38 map("n", "<leader>sf", require("telescope.builtin").find_files, "files")
39 map("n", "<leader>sh", require("telescope.builtin").help_tags, "help")
40 map("n", "<leader>sw", require("telescope.builtin").grep_string, "current word")
41 map("n", "<leader>sg", require("telescope.builtin").live_grep, "grep")
42 map("n", "<leader>sd", require("telescope.builtin").diagnostics, "diagnostics")
43 end,
44 },
45}
diff --git a/.config/nvim/lua/plugins/tpope.lua b/.config/nvim/lua/plugins/tpope.lua
new file mode 100644
index 0000000..5396303
--- /dev/null
+++ b/.config/nvim/lua/plugins/tpope.lua
@@ -0,0 +1,11 @@
1return {
2 {
3 "tpope/vim-repeat"
4 },
5 {
6 "tpope/vim-unimpaired"
7 },
8 {
9 "tpope/vim-characterize"
10 },
11}
diff --git a/.config/nvim/lua/plugins/treesitter.lua b/.config/nvim/lua/plugins/treesitter.lua
new file mode 100644
index 0000000..c454b48
--- /dev/null
+++ b/.config/nvim/lua/plugins/treesitter.lua
@@ -0,0 +1,73 @@
1return {
2 {
3 "nvim-treesitter/nvim-treesitter",
4 build = function()
5 pcall(require("nvim-treesitter.install").update({ with_sync = true }))
6 end,
7 dependencies = {
8 "nvim-treesitter/nvim-treesitter-textobjects",
9 },
10 config = function()
11 require("nvim-treesitter.configs").setup({
12 ensure_installed = { "bash", "bibtex", "c", "cpp", "css", "fish", "http", "latex", "lua", "python", "rust", "vim" },
13 ignore_install = { },
14 auto_install = true,
15 sync_install = false,
16 highlight = {
17 enable = true,
18 disable = { "latex" },
19 additional_vim_regex_highlighting = false,
20 },
21 indent = {
22 enable = true,
23 disable = { "python" }
24 },
25 incremental_selection = {
26 enable = true,
27 keymaps = {
28 init_selection = "gnn",
29 node_incremental = "grn",
30 scope_incremental = "grc",
31 node_decremental = "grm",
32 },
33 },
34 textobjects = {
35 select = {
36 enable = true,
37 lookahead = true, -- automatically jump forward to textobj, similar to targets.vim
38 keymaps = {
39 -- you can use the capture groups defined in textobjects.scm
40 ["aa"] = "@parameter.outer",
41 ["ia"] = "@parameter.inner",
42 ["af"] = "@function.outer",
43 ["if"] = "@function.inner",
44 ["ac"] = "@class.outer",
45 ["ic"] = "@class.inner",
46 },
47 },
48 move = {
49 enable = true,
50 set_jumps = true, -- whether to set jumps in the jumplist
51 goto_next_start = {
52 ["]m"] = "@function.outer",
53 ["]]"] = "@class.outer",
54 },
55 goto_next_end = {
56 ["]M"] = "@function.outer",
57 ["]["] = "@class.outer",
58 },
59 goto_previous_start = {
60 ["[m"] = "@function.outer",
61 ["[["] = "@class.outer",
62 },
63 goto_previous_end = {
64 ["[M"] = "@function.outer",
65 ["[]"] = "@class.outer",
66 },
67 },
68 },
69 modules = { },
70 })
71 end,
72 },
73}
diff --git a/.config/nvim/lua/plugins/trouble.lua b/.config/nvim/lua/plugins/trouble.lua
new file mode 100644
index 0000000..6d72bd9
--- /dev/null
+++ b/.config/nvim/lua/plugins/trouble.lua
@@ -0,0 +1,14 @@
1return {
2 "folke/trouble.nvim",
3 dependencies = { "nvim-tree/nvim-web-devicons" },
4 opts = {},
5 config = function()
6 local map = require("helpers.keys").map
7 map("n", "<leader>xx", function() require("trouble").open() end, "trouble: open")
8 map("n", "<leader>xw", function() require("trouble").open("workspace_diagnostics") end, "trouble: open workspace diagnostics")
9 map("n", "<leader>xd", function() require("trouble").open("document_diagnostics") end, "trouble: open document diagnostics")
10 map("n", "<leader>xq", function() require("trouble").open("quickfix") end, "trouble: open quickfix")
11 map("n", "<leader>xl", function() require("trouble").open("loclist") end, "trouble: open loclist")
12 map("n", "gR", function() require("trouble").open("lsp_references") end, "trouble: open lsp references")
13 end,
14}
diff --git a/.config/nvim/lua/plugins/turkish-deasciifier.lua b/.config/nvim/lua/plugins/turkish-deasciifier.lua
new file mode 100644
index 0000000..c39a35d
--- /dev/null
+++ b/.config/nvim/lua/plugins/turkish-deasciifier.lua
@@ -0,0 +1,24 @@
1return {
2 {
3 "yigitsever/turkish-deasciifier.vim",
4 init = function()
5 local map = require("helpers.keys").map
6
7 -- brute force deasciify everything
8 map({ "n", "x" }, "<leader>tc", "TurkishDeasciifyForce()", "force turkish characters",
9 { expr = true })
10 map("n", "<leader>tctc", "TurkishDeasciifyForce() .. '_'", "force turkish characters eol",
11 { expr = true })
12
13 -- use turkish-mode to selectively deasciify
14 map({ "n", "x" }, "<Leader>tr", "TurkishDeasciify()", "infer turkish characters", { expr = true })
15 map("n", "<Leader>trtr", "TurkishDeasciify() .. '_'", "infer turkish characters eol",
16 { expr = true })
17
18 -- ascii everything
19 map({ "n", "x" }, "<Leader>rt", "TurkishAsciify()", "remove turkish characters", { expr = true })
20 map("n", "<Leader>rtrt", "TurkishAsciify() .. '_'", "remove turkish characters eol",
21 { expr = true })
22 end,
23 }
24}
diff --git a/.config/nvim/lua/plugins/vimwiki.lua b/.config/nvim/lua/plugins/vimwiki.lua
new file mode 100644
index 0000000..11d4c2b
--- /dev/null
+++ b/.config/nvim/lua/plugins/vimwiki.lua
@@ -0,0 +1,28 @@
1return {
2 {
3 "vimwiki/vimwiki",
4 init = function ()
5 vim.g.vimwiki_list = {
6 {
7 path = '/home/yigit/nextcloud/personal_wiki/text',
8 path_html = '/home/yigit/nextcloud/personal_wiki/html',
9 auto_generate_tags = 1,
10 automatic_nested_syntaxes = 1,
11 template_path = '/home/yigit/nextcloud/personal_wiki/templates',
12 template_default = 'default_template',
13 template_ext = '.html',
14 auto_export = 1,
15 auto_tags = 1
16 }
17 }
18 vim.g.vimwiki_hl_headers = 1
19
20 local map = require("helpers.keys").map
21
22 --toggle checkmarks
23 map('n', '<leader>v', '<Plug>VimwikiToggleListItem', "vimwiki: toggle checkmark")
24 -- add/increase header level
25 map('n', '<leader>a', '<Plug>VimwikiAddHeaderLevel', "vimwiki: add header level")
26 end,
27 },
28}
diff --git a/.config/nvim/lua/plugins/which-key.lua b/.config/nvim/lua/plugins/which-key.lua
new file mode 100644
index 0000000..21048b9
--- /dev/null
+++ b/.config/nvim/lua/plugins/which-key.lua
@@ -0,0 +1,14 @@
1return {
2 {
3 "folke/which-key.nvim",
4 event = "VeryLazy",
5 init = function()
6 vim.o.timeout = true
7 vim.o.timeoutlen = 500
8 end,
9 config = function()
10 local wk = require("which-key")
11 wk.setup()
12 end,
13 }
14}