summaryrefslogtreecommitdiffstatshomepage
path: root/nvim/lua
diff options
context:
space:
mode:
Diffstat (limited to 'nvim/lua')
-rw-r--r--nvim/lua/autocommands.lua55
-rw-r--r--nvim/lua/icons.lua106
-rw-r--r--nvim/lua/mappings.lua276
-rw-r--r--nvim/lua/options.lua (renamed from nvim/lua/configs.lua)50
-rw-r--r--nvim/lua/plugins.lua169
-rw-r--r--nvim/lua/plugins/alpha.lua56
-rw-r--r--nvim/lua/plugins/blankline.lua7
-rw-r--r--nvim/lua/plugins/bufferline.lua142
-rw-r--r--nvim/lua/plugins/cmp.lua127
-rw-r--r--nvim/lua/plugins/dap.lua28
-rw-r--r--nvim/lua/plugins/git-blame.lua3
-rw-r--r--nvim/lua/plugins/git-worktree.lua12
-rw-r--r--nvim/lua/plugins/gitsigns.lua48
-rw-r--r--nvim/lua/plugins/lsp-installer.lua5
-rw-r--r--nvim/lua/plugins/lsp-signature.lua59
-rw-r--r--nvim/lua/plugins/lspconfig.lua26
-rw-r--r--nvim/lua/plugins/lspkind.lua7
-rw-r--r--nvim/lua/plugins/lspstatus.lua17
-rw-r--r--nvim/lua/plugins/lualine.lua116
-rw-r--r--nvim/lua/plugins/luasnip.lua19
-rw-r--r--nvim/lua/plugins/neogit.lua7
-rw-r--r--nvim/lua/plugins/null-ls.lua51
-rw-r--r--nvim/lua/plugins/nvim-tree.lua112
-rw-r--r--nvim/lua/plugins/project.lua13
-rw-r--r--nvim/lua/plugins/renamer.lua46
-rw-r--r--nvim/lua/plugins/session_manager.lua25
-rw-r--r--nvim/lua/plugins/telescope.lua12
-rw-r--r--nvim/lua/plugins/treesitter.lua7
-rw-r--r--nvim/lua/plugins/which-key.lua34
29 files changed, 1159 insertions, 476 deletions
diff --git a/nvim/lua/autocommands.lua b/nvim/lua/autocommands.lua
new file mode 100644
index 0000000..c87fb70
--- /dev/null
+++ b/nvim/lua/autocommands.lua
@@ -0,0 +1,55 @@
+-- to Show whitespace, MUST be inserted BEFORE the colorscheme command
+vim.cmd [[
+ augroup _general_settings
+ autocmd!
+ autocmd FileType qf,help,man,lspinfo,spectre_panel nnoremap <silent> <buffer> q :close<CR>
+ autocmd TextYankPost * silent!lua require('vim.highlight').on_yank({higroup = 'Visual', timeout = 200})
+ autocmd BufWritePre * :%s/\s\+$//e
+ autocmd BufWinEnter * :set formatoptions-=cro
+ autocmd BufEnter * set fo-=c fo-=r fo-=o
+ autocmd FileType qf set nobuflisted
+ autocmd CmdWinEnter * quit
+ autocmd FileType xml,html,xhtml,css,scss,javascript,lua,dart setlocal shiftwidth=2 tabstop=2
+ autocmd BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
+ augroup end
+
+ augroup format_on_save
+ autocmd!
+ autocmd BufWritePre * lua vim.lsp.buf.formatting()
+ augroup end
+
+ augroup _git
+ autocmd!
+ autocmd FileType gitcommit setlocal wrap
+ autocmd FileType gitcommit setlocal spell
+ augroup end
+
+ augroup _markdown
+ autocmd!
+ autocmd FileType markdown setlocal wrap
+ autocmd FileType markdown setlocal spell
+ autocmd BufNewFile,BufRead *.mdx set filetype=markdown
+ augroup end
+
+ augroup _latex
+ autocmd!
+ autocmd FileType latex,tex,plaintex setlocal wrap
+ autocmd FileType latex,tex,plaintex setlocal spell
+ autocmd FileType latex,tex,plaintex setlocal linebreak
+ augroup end
+
+ augroup _json
+ autocmd!
+ autocmd BufEnter *.json set ai expandtab shiftwidth=2 tabstop=2 sta fo=croql
+ augroup end
+
+ augroup _auto_resize
+ autocmd!
+ autocmd VimResized * tabdo wincmd =
+ augroup end
+
+ augroup _alpha
+ autocmd!
+ autocmd User AlphaReady set showtabline=0 | autocmd BufUnload <buffer> set showtabline=2
+ augroup end
+]]
diff --git a/nvim/lua/icons.lua b/nvim/lua/icons.lua
new file mode 100644
index 0000000..be868a0
--- /dev/null
+++ b/nvim/lua/icons.lua
@@ -0,0 +1,106 @@
+-- https://github.com/microsoft/vscode/blob/main/src/vs/base/common/codicons.ts
+-- go to the above and then enter <c-v>u<unicode> and the symbold should appear
+-- or go here and upload the font file: https://mathew-kurian.github.io/CharacterMap/
+-- find more here: https://www.nerdfonts.com/cheat-sheet
+--   פּ ﯟ   蘒練 some other good icons
+return {
+ kind = {
+ Text = "",
+ -- Method = "m",
+ -- Function = "",
+ -- Constructor = "",
+ Method = "",
+ Function = "",
+ Constructor = "",
+ Field = "",
+ -- Variable = "",
+ Variable = "",
+ Class = "",
+ Interface = "",
+ -- Module = "",
+ Module = "",
+ Property = "",
+ Unit = "",
+ Value = "",
+ Enum = "",
+ -- Keyword = "",
+ Keyword = "",
+ -- Snippet = "",
+ Snippet = "",
+ Color = "",
+ File = "",
+ Reference = "",
+ Folder = "",
+ EnumMember = "",
+ Constant = "",
+ Struct = "",
+ Event = "",
+ Operator = "",
+ TypeParameter = "",
+ },
+ type = {
+ Array = "",
+ Number = "",
+ String = "",
+ Boolean = "蘒",
+ Object = "",
+ },
+ documents = {
+ File = "",
+ Files = "",
+ Folder = "",
+ OpenFolder = "",
+ },
+ git = {
+ Add = "",
+ Mod = "",
+ Remove = "",
+ Ignore = "",
+ Rename = "",
+ Diff = "",
+ Repo = "",
+ },
+ ui = {
+ Lock = "",
+ Circle = "",
+ BigCircle = "",
+ BigUnfilledCircle = "",
+ Close = "",
+ NewFile = "",
+ Search = "",
+ Lightbulb = "",
+ Project = "",
+ Dashboard = "",
+ History = "",
+ Comment = "",
+ Bug = "",
+ Code = "",
+ Telescope = "",
+ Gear = "",
+ Package = "",
+ List = "",
+ SignIn = "",
+ Check = "",
+ Fire = "",
+ Note = "",
+ BookMark = "",
+ Pencil = "",
+ -- ChevronRight = "",
+ ChevronRight = ">",
+ Table = "",
+ Calendar = "",
+ },
+ diagnostics = {
+ Error = "",
+ Warning = "",
+ Information = "",
+ Question = "",
+ Hint = "",
+ },
+ misc = {
+ Robot = "ﮧ",
+ Squirrel = "",
+ Tag = "",
+ Watch = "",
+ },
+} \ No newline at end of file
diff --git a/nvim/lua/mappings.lua b/nvim/lua/mappings.lua
index 83d3f28..3b6c7d5 100644
--- a/nvim/lua/mappings.lua
+++ b/nvim/lua/mappings.lua
@@ -1,87 +1,193 @@
-local map = require('cartographer')
-
-vim.g.mapleader = ' '
-
--- wrap
-map.n.nore['<Leader>w'] = ':set wrap! linebreak!<CR>'
-map.n.nore['j'] = 'gj'
-map.n.nore['k'] = 'gk'
-
--- navigation
---- behave like other capitals
-map.n.nore['Y'] = 'y$'
-
---- keeping it centered
-map.n.nore['n'] = 'nzzzv'
-map.n.nore['N'] = 'Nzzzv'
-map.n.nore['J'] = 'mzJ`z'
-
---- moving text
-map.v.nore['J'] = [[:m '>+1<CR>gv=gv]]
-map.v.nore['K'] = [[:m '<-2<CR>gv=gv]]
-map.n.nore['<leader>k'] = ':m .-2<CR>=='
-map.n.nore['<leader>j'] = ':m .+1<CR>=='
-
--- telescope
-map.n.nore.silent['<C-a>'] = [[<Cmd>Telescope buffers show_all_buffers=true theme=get_dropdown<CR>]]
-map.n.nore.silent['<C-e>'] = [[<Cmd>Telescope frecency theme=get_dropdown<CR>]]
-map.n.nore.silent['<C-h>'] = [[<Cmd>Telescope git_files theme=get_dropdown<CR>]]
-map.n.nore.silent['<C-d>'] = [[<Cmd>Telescope find_files theme=get_dropdown<CR>]]
-map.n.nore.silent['<C-g>'] = [[<Cmd>Telescope live_grep theme=get_dropdown<CR>]]
--- map.v.nore.silent["<leader>rr"] = [[:lua require('telescope').extensions.refactoring.refactors()<CR>]]
-
--- refactoring
-map.v.nore.silent['<leader>re'] = [[:lua require("refactoring").refactor(106)<CR>]]
-map.n.nore.silent['<leader>ri'] = [[:lua require("refactoring").refactor(123)<CR>]]
-map.n.nore.silent['<leader>dh'] = [[:lua print(vim.inspect(require("refactoring").debug.get_path()))<CR>]]
-map.n.nore.silent['<leader>dg'] = [[:lua require("refactoring").debug.printf({below = false})<CR>]]
-map.n.nore.silent['<leader>dm'] = [[:lua require("refactoring").debug.printf({below = true})<CR>]]
-map.n.nore.silent['<leader>df'] = [[:lua require("refactoring").debug.print_var({below = false})<CR>]]
-map.n.nore.silent['<leader>db'] = [[:lua require("refactoring").debug.print_var({below = true})<CR>]]
-
---- quicklist
-map.n.nore['<leader>qn'] = '<Cmd>:cnext<CR>'
-map.n.nore['<leader>qp'] = '<Cmd>:cprev<CR>'
-map.n.nore['<leader>qo'] = '<Cmd>:copen<CR>'
-
--- lua tree
-require'nvim-tree'.setup {}
-map.nore['<C-b>'] = '<Cmd>NvimTreeToggle<CR>'
-map.n.nore['<Leader>tf'] = '<Cmd>NvimTreeFindFileToggle<CR>'
-map.n.nore['<Leader>tr'] = '<Cmd>NvimTreeRefresh<CR>'
-
--- language server
-map.n.nore['<Leader>vd'] = '<Cmd>lua vim.lsp.buf.definition()<CR>'
-map.n.nore['<Leader>vi'] = '<Cmd>lua vim.lsp.buf.implementation()<CR>'
-map.n.nore['<Leader>vsh'] = '<Cmd>lua vim.lsp.buf.signature_help()<CR>'
-map.n.nore['<Leader>vrr'] = '<Cmd>lua vim.lsp.buf.references()<CR>'
-map.n.nore['<Leader>vrn'] = '<Cmd>lua vim.lsp.buf.rename()<CR>'
-map.n.nore['<Leader>vh'] = '<Cmd>lua vim.lsp.buf.hover()<CR>'
-map.n.nore['<Leader>vca'] = '<Cmd>lua vim.lsp.buf.code_action()<CR>'
-map.n.nore['<Leader>vsd'] = '<Cmd>lua vim.lsp.diagnostic.show_line_diagnostics()<CR>'
-map.n.nore['<Leader>vn'] = '<Cmd>lua vim.lsp.diagnostic.goto_next()<CR>'
-map.n.nore['<Leader>vp'] = '<Cmd>lua vim.lsp.diagnostic.goto_prev()<CR>'
-map.n.nore['<Leader>vf'] = '<Cmd>Format<CR>'
-
--- debug
-map.n.nore['<F5>'] = [[<Cmd>lua require('dap').continue()<CR>]]
-map.n.nore['<F10>'] = [[<Cmd>lua require('dap').step_over()<CR>]]
-map.n.nore['<F11>'] = [[<Cmd>lua require('dap').step_into()<CR>]]
-map.n.nore['<F12>'] = [[<Cmd>lua require('dap').step_out()<CR>]]
-
--- git
-local function git_branches()
- require("telescope.builtin").git_branches({
- attach_mappings = function(_, map)
- map("i", "<C-d>", actions.git_delete_branch)
- map("n", "<C-d>", actions.git_delete_branch)
- return true
- end,
- })
+local status_ok, which_key = pcall(require, "which-key")
+if not status_ok then
+ return
end
-map.n.nore['<leader>gb'] = git_branches
-map.n.nore['<Leader>go'] = '<Cmd>Neogit<CR>'
-map.n.nore['<Leader>gc'] = '<Cmd>Neogit commit<CR>'
-map.n.nore['<Leader>gws'] = [[<Cmd>lua require('telescope').extensions.git_worktree.git_worktrees()<CR>]]
-map.n.nore['<Leader>gwc'] = [[<Cmd>:lua require('telescope').extensions.git_worktree.create_git_worktree()<CR>]]
+local opts = {
+ 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 mappings = {
+ -- Ctrl maps
+ ["<C-s>"] = { "<cmd>w!<CR>", "Save" },
+ ["<C-b>"] = { "<Cmd>NvimTreeToggle<CR>", "Explorer" },
+}
+
+local nopts = {
+ mode = "n", -- NORMAL 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 nmappings = {
+ -- Ctrl maps
+ ["<C-/>"] = { "<cmd>lua require('Comment.api').toggle_current_linewise()<CR>", "Comment" },
+
+ -- Prefix "<leader>"
+ ["<leader>"] = {
+ a = { "<cmd>Alpha<cr>", "Alpha" },
+ c = { "<cmd>Bdelete!<CR>", "Close Buffer" },
+ q = { "<cmd>q!<CR>", "Quit" },
+ R = { "<cmd>lua require('renamer').rename()<cr>", "Rename" },
+ w = { "<cmd>w!<CR>", "Save" },
+ W = { ":set wrap! linebreak!<CR>", "Toggle Line Wrap" },
+ z = { "<cmd>ZenMode<cr>", "Zen" },
+ ["/"] = { "<cmd>lua require('Comment.api').toggle_current_linewise()<CR>", "Comment" },
+
+ f = {
+ name = "Find",
+ b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
+ c = { "<cmd>Telescope colorscheme<cr>", "Colorscheme" },
+ C = { "<cmd>Telescope commands<cr>", "Commands" },
+ e = { "<cmd>Telescope frecency theme=get_dropdown<cr>", "Frecency" },
+ f = { "<cmd>Telescope find_files theme=get_dropdown<cr>", "Find files" },
+ g = { "<cmd>Telescope live_grep theme=ivy<cr>", "Find Text" },
+ h = { "<cmd>Telescope help_tags<cr>", "Help" },
+ i = { "<cmd>lua require('telescope').extensions.media_files.media_files()<cr>", "Media" },
+ k = { "<cmd>Telescope keymaps<cr>", "Keymaps" },
+ l = { "<cmd>Telescope resume<cr>", "Last Search" },
+ m = { "<cmd>Telescope man_pages<cr>", "Man Pages" },
+ p = { "<cmd>lua require('telescope').extensions.projects.projects()<cr>", "Projects" },
+ r = { "<cmd>Telescope oldfiles<cr>", "Recent File" },
+ R = { "<cmd>Telescope registers<cr>", "Registers" },
+ t = { "<cmd>Telescope buffers show_all_buffers=true theme=get_dropdown<cr>", "Buffers" },
+ },
+
+ g = {
+ name = "Git",
+ b = { "<cmd>Telescope git_branches<cr>", "Checkout branch" },
+ c = { "<cmd>Telescope git_commits<cr>", "Checkout commit" },
+ d = { "<cmd>Gitsigns diffthis HEAD<cr>", "Diff" },
+ g = { "<cmd>LazyGit<CR>", "Lazygit" },
+ j = { "<cmd>lua require 'gitsigns'.next_hunk()<cr>", "Next Hunk" },
+ k = { "<cmd>lua require 'gitsigns'.prev_hunk()<cr>", "Prev Hunk" },
+ l = { "<cmd>GitBlameToggle<cr>", "Blame" },
+ o = { "<cmd>Telescope git_status<cr>", "Open changed file" },
+ p = { "<cmd>lua require 'gitsigns'.preview_hunk()<cr>", "Preview Hunk" },
+ r = { "<cmd>lua require 'gitsigns'.reset_hunk()<cr>", "Reset Hunk" },
+ R = { "<cmd>lua require 'gitsigns'.reset_buffer()<cr>", "Reset Buffer" },
+ s = { "<cmd>lua require 'gitsigns'.stage_hunk()<cr>", "Stage Hunk" },
+ u = { "<cmd>lua require 'gitsigns'.undo_stage_hunk()<cr>", "Undo Stage Hunk" },
+ w = {
+ name = "Worktree",
+ s = { [[<Cmd>lua require('telescope').extensions.git_worktree.git_worktrees()<CR>]], "Switch" },
+ c = { [[<Cmd>lua require('telescope').extensions.git_worktree.create_git_worktree()<CR>]], "Create" },
+ },
+ },
+
+ l = {
+ name = "LSP",
+ a = { "<cmd>lua vim.lsp.buf.code_action()<cr>", "Code Action" },
+ d = { "<cmd>TroubleToggle<cr>", "Diagnostics" },
+ f = { "<cmd>lua vim.lsp.buf.formatting()<cr>", "Format" },
+ -- F = { "<cmd>LspToggleAutoFormat<cr>", "Toggle Autoformat" },
+ g = {
+ name = "Goto",
+ d = { "<cmd>lua vim.lsp.buf.definition()<CR>", "Definition" },
+ D = { "<cmd>lua vim.lsp.buf.declaration()<CR>", "Declaration" },
+ i = { "<cmd>lua vim.lsp.buf.implementation()<CR>", "Implementation" },
+ r = { "<cmd>lua vim.lsp.buf.references()<CR>", "References" },
+ },
+ h = { "<Cmd>lua vim.lsp.buf.hover()<CR>", "Hover" },
+ H = { "<Cmd>lua vim.lsp.buf.signature_help()<CR>", "Signature Help" },
+ i = { "<cmd>LspInfo<cr>", "Info" },
+ I = { "<cmd>LspInstallInfo<cr>", "Installer Info" },
+ j = { "<cmd>lua vim.diagnostic.goto_next({buffer=0})<CR>", "Next Diagnostic" },
+ k = { "<cmd>lua vim.diagnostic.goto_prev({buffer=0})<cr>", "Prev Diagnostic" },
+ l = { "<cmd>lua vim.lsp.codelens.run()<cr>", "CodeLens Action" },
+ o = { "<cmd>SymbolsOutline<cr>", "Outline" },
+ q = { "<cmd>lua vim.lsp.diagnostic.set_loclist()<cr>", "Quickfix" },
+ r = { "<cmd>lua vim.lsp.buf.rename()<cr>", "Rename" },
+ R = { "<cmd>TroubleToggle lsp_references<cr>", "References" },
+ s = { "<cmd>Telescope lsp_document_symbols<cr>", "Document Symbols" },
+ S = { "<cmd>Telescope lsp_dynamic_workspace_symbols<cr>", "Workspace Symbols" },
+ w = { "<cmd>Telescope lsp_workspace_diagnostics<cr>", "Workspace Diagnostics" },
+ },
+
+ p = {
+ name = "Packer",
+ c = { "<cmd>PackerCompile<cr>", "Compile" },
+ i = { "<cmd>PackerInstall<cr>", "Install" },
+ s = { "<cmd>PackerSync<cr>", "Sync" },
+ S = { "<cmd>PackerStatus<cr>", "Status" },
+ u = { "<cmd>PackerUpdate<cr>", "Update" },
+ },
+
+ r = {
+ name = "Replace",
+ f = { "<cmd>lua require('spectre').open_file_search()<cr>", "Replace Buffer" },
+ r = { "<cmd>lua require('spectre').open()<cr>", "Replace" },
+ w = { "<cmd>lua require('spectre').open_visual({select_word=true})<cr>", "Replace Word" },
+ },
+
+ s = {
+ name = "Surround",
+ ["."] = { "<cmd>lua require('surround').repeat_last()<cr>", "Repeat" },
+ a = { "<cmd>lua require('surround').surround_add(true)<cr>", "Add" },
+ b = { "<cmd>lua require('surround').toggle_brackets()<cr>", "Brackets" },
+ d = { "<cmd>lua require('surround').surround_delete()<cr>", "Delete" },
+ q = { "<cmd>lua require('surround').toggle_quotes()<cr>", "Quotes" },
+ r = { "<cmd>lua require('surround').surround_replace()<cr>", "Replace" },
+ },
+
+ t = {
+ name = "Terminal",
+ ["1"] = { ":1ToggleTerm<cr>", "1" },
+ ["2"] = { ":2ToggleTerm<cr>", "2" },
+ ["3"] = { ":3ToggleTerm<cr>", "3" },
+ ["4"] = { ":4ToggleTerm<cr>", "4" },
+ f = { "<cmd>ToggleTerm direction=float<cr>", "Float" },
+ h = { "<cmd>ToggleTerm size=10 direction=horizontal<cr>", "Horizontal" },
+ v = { "<cmd>ToggleTerm size=80 direction=vertical<cr>", "Vertical" },
+ },
+
+ T = {
+ name = "Treesitter",
+ h = { "<cmd>TSHighlightCapturesUnderCursor<cr>", "Highlight" },
+ p = { "<cmd>TSPlaygroundToggle<cr>", "Playground" },
+ },
+ },
+ -- Prefix "m"
+ m = {
+ a = { "<cmd>BookmarkAnnotate<cr>", "Annotate" },
+ c = { "<cmd>BookmarkClear<cr>", "Clear" },
+ h = { '<cmd>lua require("harpoon.mark").add_file()<cr>', "Harpoon" },
+ j = { "<cmd>BookmarkNext<cr>", "Next" },
+ k = { "<cmd>BookmarkPrev<cr>", "Prev" },
+ m = { "<cmd>BookmarkToggle<cr>", "Toggle" },
+ s = {
+ "<cmd>lua require('telescope').extensions.vim_bookmarks.all({ hide_filename=false, prompt_title=\"bookmarks\", shorten_path=false })<cr>",
+ "Show",
+ },
+ u = { '<cmd>lua require("harpoon.ui").toggle_quick_menu()<cr>', "Harpoon UI" },
+ x = { "<cmd>BookmarkClearAll<cr>", "Clear All" },
+ },
+}
+
+local vopts = {
+ mode = "v", -- VISUAL 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 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" },
+ }
+}
+
+which_key.register(mappings, opts)
+which_key.register(nmappings, nopts)
+which_key.register(vmappings, vopts)
diff --git a/nvim/lua/configs.lua b/nvim/lua/options.lua
index 6ccb40c..6fb959d 100644
--- a/nvim/lua/configs.lua
+++ b/nvim/lua/options.lua
@@ -1,12 +1,17 @@
local g = vim.g -- global variables
-local cmd = vim.cmd -- execute Vim commands
local opt = vim.opt -- vim options
local exec = vim.api.nvim_exec -- execute Vimscript
+g.mapleader = ' '
+
+-- set colorscheme
g.vscode_style = "dark"
g.vscode_transparent = 1
g.vscode_italic_comment = 1
g.vscode_disable_nvimtree_bg = true
+
+vim.cmd('colorscheme vscode')
+
g.tex_flavor = "latex";
-- global options
@@ -30,7 +35,7 @@ local options = {
undofile = true,
undodir = vim.fn.stdpath("config") .. "/undo",
clipboard = opt.clipboard + "unnamedplus", -- copy & paste
- shortmess = opt.shortmess + "c"
+ shortmess = opt.shortmess + "c",
wrap = false, -- don't automatically wrap on load
showmatch = true, -- show the matching part of the pair for [] {} and ()
cursorline = true, -- highlight current line
@@ -47,7 +52,7 @@ local options = {
updatetime = 500, -- CursorHold interval
expandtab = true,
softtabstop = 4,
- et.textwidth = 100,
+ textwidth = 100,
shiftwidth = 4, -- spaces per tab (when shifting), when using the >> or << commands, shift lines by 4 spaces
tabstop = 4, -- spaces per tab
smarttab = true, -- <tab>/<BS> indent/dedent in leading whitespace
@@ -68,42 +73,3 @@ local options = {
for k, v in pairs(options) do
vim.opt[k] = v
end
-
--- highlight on yank
-exec([[
- augroup YankHighlight
- autocmd!
- autocmd TextYankPost * silent! lua vim.highlight.on_yank{higroup="IncSearch", timeout=500, on_visual=true}
- augroup end
-]], false)
-
--- to Show whitespace, MUST be inserted BEFORE the colorscheme command
-cmd 'autocmd ColorScheme * highlight ExtraWhitespace ctermbg=red guibg=grey'
-
--- set colorscheme
-cmd 'colorscheme vscode'
-
--- jump to the last position when reopening a file
-cmd [[
-if has("autocmd")
- au BufReadPost * if line("'\"") > 0 && line("'\"") <= line("$") | exe "normal! g`\"" | endif
-endif
-]]
-
--- remove whitespace on save
-cmd [[au BufWritePre * :%s/\s\+$//e]]
-
--- don't auto commenting new lines
-cmd [[au BufEnter * set fo-=c fo-=r fo-=o]]
-
--- 2 spaces for selected filetypes
-cmd [[ autocmd FileType xml,html,xhtml,css,scss,javascript,lua,dart setlocal shiftwidth=2 tabstop=2 ]]
-
--- json
-cmd [[ au BufEnter *.json set ai expandtab shiftwidth=2 tabstop=2 sta fo=croql ]]
-
---- latex
-cmd [[ autocmd FileType latex,tex,plaintex set wrap linebreak ]]
-
--- markdown
-cmd [[ autocmd BufNewFile,BufRead *.mdx set filetype=markdown ]] \ No newline at end of file
diff --git a/nvim/lua/plugins.lua b/nvim/lua/plugins.lua
index 9ea568c..de4c47f 100644
--- a/nvim/lua/plugins.lua
+++ b/nvim/lua/plugins.lua
@@ -43,6 +43,7 @@ return packer.startup(function(use)
-- My plugins here
-- Have packer manage itself
+
use "wbthomason/packer.nvim"
use {
@@ -52,12 +53,8 @@ return packer.startup(function(use)
}
use 'lewis6991/impatient.nvim'
-
use 'andweeb/presence.nvim'
-
- use 'Iron-E/nvim-cartographer'
-
- use 'Mofiqul/vscode.nvim'
+ use 'Mofiqul/vscode.nvim' -- vscode theme
use {
'tpope/vim-dispatch',
@@ -69,34 +66,30 @@ return packer.startup(function(use)
}
}
- use {
- -- A collection of common configurations for Neovim's built-in language server client
- 'neovim/nvim-lspconfig',
- config = [[require('plugins/lspconfig')]],
+ use {
+ 'neovim/nvim-lspconfig',
+ config = [[require('plugins/lspconfig')]]
}
- use {
- "williamboman/nvim-lsp-installer",
- config = [[require('plugins/lsp-installer')]],
+ use {
+ "williamboman/nvim-lsp-installer",
+ config = [[require('plugins/lsp-installer')]]
}
use 'nvim-lua/lsp_extensions.nvim'
use 'simrat39/rust-tools.nvim'
- use 'folke/trouble.nvim'
- use 'ray-x/lsp_signature.nvim'
use 'simrat39/symbols-outline.nvim'
- use 'kosayoda/nvim-lightbulb'
- use {
- -- vscode-like pictograms for neovim lsp completion items Topics
- "onsails/lspkind-nvim",
- config = [[require('plugins/lspkind')]]
+ use {
+ "folke/trouble.nvim",
+ cmd = "TroubleToggle"
}
use {
- -- A completion plugin for neovim coded in Lua.
'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.
@@ -108,41 +101,31 @@ return packer.startup(function(use)
config = [[require('plugins/cmp')]],
}
- use { 'nvim-telescope/telescope-dap.nvim' }
-
- use {
- 'nvim-telescope/telescope-fzf-native.nvim',
- run = 'make',
- }
-
-
- use {
- "nvim-telescope/telescope-frecency.nvim",
- requires = {
- "tami5/sqlite.lua"
- }
- }
-
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 {
- -- Snippet Engine for Neovim written in Lua.
+ "jose-elias-alvarez/null-ls.nvim",
+ requires = "nvim-lua/plenary.nvim",
+ config = [[require('plugins/null-ls')]]
+ }
+
+ use {
"L3MON4D3/LuaSnip",
- requires = {
- "rafamadriz/friendly-snippets" -- Snippets collection
- },
+ requires = "rafamadriz/friendly-snippets",
config = [[require('plugins/luasnip')]]
}
use {
- -- Nvim Treesitter configurations and abstraction layer
"nvim-treesitter/nvim-treesitter",
run = ":TSUpdate",
requires = {
@@ -152,22 +135,17 @@ return packer.startup(function(use)
config = [[require('plugins/treesitter')]]
}
- use {
- "lukas-reineke/indent-blankline.nvim",
- config = [[require('plugins/blankline')]]
+ use {
+ "lukas-reineke/indent-blankline.nvim",
+ config = [[require('plugins/blankline')]]
}
- use {
- "tpope/vim-eunuch"
- }
+ use "tpope/vim-eunuch"
use {
"nvim-lualine/lualine.nvim",
requires = {
- {
- "kyazdani42/nvim-web-devicons",
- opt = true
- },
+ { "kyazdani42/nvim-web-devicons" },
},
config = [[require('plugins/lualine')]]
}
@@ -186,7 +164,8 @@ return packer.startup(function(use)
use {
'lewis6991/gitsigns.nvim',
- requires = { 'nvim-lua/plenary.nvim' },
+ requires = 'nvim-lua/plenary.nvim',
+ config = [[require('plugins/gitsigns')]],
}
use {
@@ -194,12 +173,12 @@ return packer.startup(function(use)
cmd = 'Neogit',
config = [[require('neogit').setup {disable_commit_confirmation = true, disable_signs = true}]]
}
+
use 'kdheepak/lazygit.nvim'
- use {
- "kyazdani42/nvim-tree.lua",
- requires = "kyazdani42/nvim-web-devicons",
- config = [[require('plugins/nvim-tree')]]
+ use {
+ "f-person/git-blame.nvim",
+ config = [[require('plugins/git-blame')]]
}
use {
@@ -208,51 +187,60 @@ return packer.startup(function(use)
config = [[vim.g.undotree_SetFocusWhenToggle = 1]],
}
- use {
- "folke/which-key.nvim",
- config = [[require("which-key").setup({})]],
+ use {
+ "ThePrimeagen/git-worktree.nvim",
+ config = [[require('plugins/git-worktree')]]
}
- use {
- 'Pocco81/DAPInstall.nvim',
- config = [[require("dap-install").config("chrome", {})]],
+ use {
+ 'ThePrimeagen/refactoring.nvim',
+ opt = true
}
use {
- 'mfussenegger/nvim-dap',
- config = [[require('plugins/dap')]],
- module = 'dap',
+ "ahmedkhalf/project.nvim",
+ config = [[require('plugins/project')]]
}
- use {
- 'puremourning/vimspector',
- requires = 'nvim-dap',
- after = 'nvim-dap',
- setup = [[vim.g.vimspector_enable_mappings = 'HUMAN']],
+ use {
+ "folke/which-key.nvim",
+ config = [[require('plugins/which-key')]]
}
use {
- 'rcarriga/nvim-dap-ui',
- requires = 'nvim-dap',
- disable = true,
- after = 'nvim-dap',
- config = [[require('dapui').setup()]],
+ 'mfussenegger/nvim-dap',
+ requires = {
+ "theHamsta/nvim-dap-virtual-text",
+ "rcarriga/nvim-dap-ui",
+ "Pocco81/DAPInstall.nvim",
+ },
+ config = [[require('plugins/dap')]],
}
- use {
- "ThePrimeagen/git-worktree.nvim",
- config = [[require('plugins/git-worktree')]]
+ 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 {
- 'ThePrimeagen/refactoring.nvim',
- opt = true
- -- Can't get to work...
- -- config = [[require('telescope').load_extension('refactoring')]],
+ use {
+ "filipdutescu/renamer.nvim",
+ config = [[require('plugins/renamer')]]
+ }
+
+ use {
+ 'numToStr/Comment.nvim',
+ config = [[require('Comment').setup()]]
}
use {
- -- Highlight colors
'norcalli/nvim-colorizer.lua',
ft = {
'css',
@@ -263,13 +251,26 @@ return packer.startup(function(use)
config = [[require('colorizer').setup {'css', 'javascript', 'vim', 'html'}]],
}
- -- Buffer management
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
diff --git a/nvim/lua/plugins/alpha.lua b/nvim/lua/plugins/alpha.lua
new file mode 100644
index 0000000..87ae48a
--- /dev/null
+++ b/nvim/lua/plugins/alpha.lua
@@ -0,0 +1,56 @@
+local status_ok, alpha = pcall(require, "alpha")
+if not status_ok then
+ return
+end
+
+local status_ok, dashboard = pcall(require, "alpha.themes.dashboard")
+if not status_ok then
+ return
+end
+
+
+-- alpha.setup(dashboard.config)
+
+local icons = require "icons"
+
+local dashboard = require "alpha.themes.dashboard"
+dashboard.section.header.val = {
+ [[ __ ]],
+ [[ ___ ___ ___ __ __ /\_\ ___ ___ ]],
+ [[ / _ `\ / __`\ / __`\/\ \/\ \\/\ \ / __` __`\ ]],
+ [[/\ \/\ \/\ __//\ \_\ \ \ \_/ |\ \ \/\ \/\ \/\ \ ]],
+ [[\ \_\ \_\ \____\ \____/\ \___/ \ \_\ \_\ \_\ \_\]],
+ [[ \/_/\/_/\/____/\/___/ \/__/ \/_/\/_/\/_/\/_/]],
+}
+dashboard.section.buttons.val = {
+ dashboard.button("f", icons.documents.Files .. " Find file", ":Telescope find_files <CR>"),
+ dashboard.button("e", icons.ui.NewFile .. " New file", ":ene <BAR> startinsert <CR>"),
+ dashboard.button(
+ "p",
+ icons.git.Repo .. " Find project",
+ ":lua require('telescope').extensions.projects.projects()<CR>"
+ ),
+ dashboard.button("r", icons.ui.History .. " Recent files", ":Telescope oldfiles <CR>"),
+ dashboard.button("t", icons.ui.List .. " Find text", ":Telescope live_grep <CR>"),
+ dashboard.button("s", icons.ui.SignIn .. " Find Session", ":Telescope sessions save_current=false <CR>"),
+ dashboard.button("c", icons.ui.Gear .. " Config", ":e ~/.config/nvim/init.lua <CR>"),
+ dashboard.button("q", icons.diagnostics.Error .. " Quit", ":qa<CR>"),
+}
+local function footer()
+ -- NOTE: requires the fortune-mod package to work
+ -- local handle = io.popen("fortune")
+ -- local fortune = handle:read("*a")
+ -- handle:close()
+ -- return fortune
+ return "tobyvin.com"
+end
+
+dashboard.section.footer.val = footer()
+
+dashboard.section.footer.opts.hl = "Type"
+dashboard.section.header.opts.hl = "Include"
+dashboard.section.buttons.opts.hl = "Keyword"
+
+dashboard.opts.opts.noautocmd = true
+-- vim.cmd([[autocmd User AlphaReady echo 'ready']])
+alpha.setup(dashboard.opts) \ No newline at end of file
diff --git a/nvim/lua/plugins/blankline.lua b/nvim/lua/plugins/blankline.lua
index d68ccf9..44f90c8 100644
--- a/nvim/lua/plugins/blankline.lua
+++ b/nvim/lua/plugins/blankline.lua
@@ -1,4 +1,9 @@
-require("indent_blankline").setup {
+local status_ok, indent_blankline = pcall(require, "indent_blankline")
+if not status_ok then
+ return
+end
+
+indent_blankline.setup {
-- for example, context is off by default, use this to turn it on
show_current_context = true,
show_current_context_start = true,
diff --git a/nvim/lua/plugins/bufferline.lua b/nvim/lua/plugins/bufferline.lua
index bd3192d..105df66 100644
--- a/nvim/lua/plugins/bufferline.lua
+++ b/nvim/lua/plugins/bufferline.lua
@@ -1,3 +1,10 @@
+local status_ok, bufferline = pcall(require, "bufferline")
+if not status_ok then
+ return
+end
+
+-- https://github.com/Mofiqul/vscode.nvim#-usage
+
local diagnostics_signs = {
['error'] = '',
warning = '',
@@ -5,7 +12,13 @@ local diagnostics_signs = {
}
require('bufferline').setup{
- options = {
+ options = {
+ indicator_icon = ' ',
+ buffer_close_icon = '',
+ modified_icon = '●',
+ close_icon = '',
+ close_command = "Bdelete! %d",
+ right_mouse_command = "Bdelete! %d",
always_show_bufferline = false,
diagnostics = 'nvim_lsp',
diagnostics_indicator = function(count, level, diagnostics_dict, context)
@@ -16,19 +29,11 @@ require('bufferline').setup{
end
return s
end,
- separator_style = 'slant',
- indicator_icon = ' ',
- buffer_close_icon = '',
- modified_icon = '●',
- close_icon = '',
- close_command = "Bdelete %d",
- right_mouse_command = "Bdelete! %d",
- left_trunc_marker = '',
- right_trunc_marker = '',
+ -- separator_style = 'slant',
offsets = {{filetype = "NvimTree", text = "EXPLORER", text_align = "center"}},
show_tab_indicators = true,
show_close_icon = false
- },
+ },
highlights = {
fill = {
guifg = {attribute = "fg", highlight = "Normal"},
@@ -40,12 +45,12 @@ require('bufferline').setup{
},
buffer_visible = {
gui = "",
- guifg = {attribute = "fg", highlight = "Normal"},
+ guifg = {attribute = "fg", highlight="Normal"},
guibg = {attribute = "bg", highlight = "Normal"}
},
buffer_selected = {
gui = "",
- guifg = {attribute = "fg", highlight = "Normal"},
+ guifg = {attribute = "fg", highlight="Normal"},
guibg = {attribute = "bg", highlight = "Normal"}
},
separator = {
@@ -53,7 +58,7 @@ require('bufferline').setup{
guibg = {attribute = "bg", highlight = "StatusLine"},
},
separator_selected = {
- guifg = {attribute = "fg", highlight = "Special"},
+ guifg = {attribute = "fg", highlight="Special"},
guibg = {attribute = "bg", highlight = "Normal"}
},
separator_visible = {
@@ -65,118 +70,13 @@ require('bufferline').setup{
guibg = {attribute = "bg", highlight = "StatusLine"}
},
close_button_selected = {
- guifg = {attribute = "fg", highlight = "normal"},
+ guifg = {attribute = "fg", highlight="normal"},
guibg = {attribute = "bg", highlight = "normal"}
},
close_button_visible = {
- guifg = {attribute = "fg", highlight = "normal"},
+ guifg = {attribute = "fg", highlight="normal"},
guibg = {attribute = "bg", highlight = "normal"}
},
}
}
-
--- local map = require('utils').map
--- local bufferline = require 'bufferline'
-
--- local bar_bg = '#1f1f1f'
--- local bar_fg = '#c9c9c9'
--- local elem_bg = '#2d2d2d'
--- local elem_fg = '#8c8c8c'
--- local selected_bg = '#444444'
--- local selected_fg = '#efefef'
--- local error_fg = '#ca241a'
--- local warning_fg = '#fabd2f'
--- local info_fg = '#83a5cb'
--- local pick_fg = '#870000'
-
--- local colors = {
--- bar = { guifg = bar_fg, guibg = bar_bg },
--- elem = { guifg = elem_fg, guibg = elem_bg },
--- elem_inactive = { guifg = elem_fg, guibg = elem_bg },
--- elem_selected = { guifg = selected_fg, guibg = selected_bg },
--- separator = { guifg = bar_bg, guibg = elem_bg },
--- separator_selected = { guifg = bar_bg, guibg = selected_bg },
--- error = { guifg = error_fg, guibg = elem_bg, guisp = error_fg },
--- error_selected = { guifg = error_fg, guibg = selected_bg, gui = '' },
--- warning = { guifg = warning_fg, guibg = elem_bg, guisp = warning_fg },
--- warning_selected = { guifg = warning_fg, guibg = selected_bg, gui = '' },
--- info = { guifg = info_fg, guibg = elem_bg, guisp = info_fg },
--- info_selected = { guifg = info_fg, guibg = selected_bg, gui = '' },
--- pick = { guifg = pick_fg, guibg = elem_bg },
--- pick_selected = { guifg = pick_fg, guibg = selected_bg },
--- }
-
--- local diagnostics_signs = {
--- ['error'] = '',
--- warning = '',
--- default = '',
--- }
-
--- require('bufferline').setup{
--- options = {
--- always_show_bufferline = false,
--- diagnostics = 'nvim_lsp',
--- diagnostics_indicator = function(count, level, diagnostics_dict, context)
--- local s = ' '
--- for e, n in pairs(diagnostics_dict) do
--- local sym = diagnostics_signs[e] or diagnostics_signs.default
--- s = s .. (#s > 1 and ' ' or '') .. sym .. ' ' .. n
--- end
--- return s
--- end,
--- separator_style = 'slant',
--- },
--- highlights = {
--- background = colors.elem_inactive,
--- buffer_selected = colors.elem_selected,
--- buffer_visible = colors.elem_inactive,
--- close_button = colors.elem,
--- close_button_selected = colors.elem_selected,
--- close_button_visible = colors.elem,
--- diagnostic = colors.info,
--- diagnostic_selected = colors.info_selected,
--- diagnostic_visible = colors.info,
--- duplicate = colors.elem,
--- duplicate_selected = colors.elem_selected,
--- duplicate_visible = colors.elem,
--- error = colors.error,
--- error_diagnostic = colors.error,
--- error_diagnostic_selected = colors.error_selected,
--- error_selected = colors.error_selected,
--- fill = colors.bar,
--- hint = colors.info,
--- hint_diagnostic = colors.info,
--- hint_diagnostic_selected = colors.info_selected,
--- hint_diagnostic_visible = colors.info,
--- hint_selected = colors.info_selected,
--- hint_visible = colors.info,
--- info = colors.info,
--- info_diagnostic = colors.info,
--- info_diagnostic_selected = colors.info_selected,
--- info_diagnostic_visible = colors.info,
--- info_selected = colors.info_selected,
--- info_visible = colors.info,
--- modified = colors.elem,
--- modified_selected = colors.elem_selected,
--- modified_visible = colors.elem,
--- pick = colors.pick,
--- pick_selected = colors.pick_selected,
--- separator = colors.separator,
--- separator_selected = colors.separator_selected,
--- separator_visible = colors.separator,
--- tab = colors.elem,
--- tab_close = colors.bar,
--- tab_selected = colors.elem_selected,
--- warning = colors.warning,
--- warning_diagnostic = colors.warning,
--- warning_diagnostic_selected = colors.warning_selected,
--- warning_diagnostic_visible = colors.warning,
--- warning_selected = colors.warning_selected,
--- warning_visible = colors.warning,
--- },
--- }
-
--- local opts = { silent = true, nowait = true }
--- map('n', 'gb', '<cmd>BufferLinePick<cr>', opts)
--- map('n', '<leader>d', '<cmd>bdelete!<cr>', opts)
diff --git a/nvim/lua/plugins/cmp.lua b/nvim/lua/plugins/cmp.lua
index 2729b0e..1a13863 100644
--- a/nvim/lua/plugins/cmp.lua
+++ b/nvim/lua/plugins/cmp.lua
@@ -1,87 +1,68 @@
--- Set completeopt to have a better completion experience
-vim.o.completeopt = 'menuone,noselect'
-local cmp = require 'cmp'
-
-cmp.setup({
- completion = {
- -- completeopt = 'menu,menuone,noinsert',
- },
- snippet = {
- expand = function(args) require('luasnip').lsp_expand(args.body) end
- },
- formatting = {
- format = function(entry, vim_item)
- -- fancy icons and a name of kind
- vim_item.kind = require("lspkind").presets.default[vim_item.kind]
- -- set a name for each source
- vim_item.menu = ({
- buffer = "[Buff]",
- nvim_lsp = "[LSP]",
- luasnip = "[LuaSnip]",
- nvim_lua = "[Lua]",
- latex_symbols = "[Latex]"
- })[entry.source.name]
- return vim_item
- end
- },
- sources = {
- {name = 'nvim_lsp'},
- {name = 'nvim_lua'},
- {name = 'path'},
- {name = 'luasnip'},
- {name = 'buffer', keyword_length = 1},
- {name = 'calc'}
- },
- experimental = {
- -- ghost_text = true,
- }
-
-})
+local status_ok, cmp = pcall(require, "cmp")
+if not status_ok then
+ return
+end
-- Require function for tab to work with LUA-SNIP
local has_words_before = function()
local line, col = unpack(vim.api.nvim_win_get_cursor(0))
return col ~= 0 and
- vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col,
- col)
+ vim.api.nvim_buf_get_lines(0, line - 1, line, true)[1]:sub(col, col)
:match("%s") == nil
end
cmp.setup({
- mapping = {
- ['<C-Space>'] = cmp.mapping.complete(),
- ['<C-e>'] = cmp.mapping.close(),
- ['<C-u>'] = cmp.mapping.scroll_docs(-4),
- ['<C-d>'] = cmp.mapping.scroll_docs(4),
- ['<CR>'] = cmp.mapping.confirm({
- behavior = cmp.ConfirmBehavior.Replace,
- select = false
- }),
+ completion = {
+ completeopt = 'menu,menuone,noinsert',
+ },
+ snippet = {
+ expand = function(args) require('luasnip').lsp_expand(args.body) end
+ },
+ mapping = {
+ ['<C-p>'] = cmp.mapping.select_prev_item(),
+ ['<C-n>'] = cmp.mapping.select_next_item(),
+ -- Add tab support
+ ['<S-Tab>'] = cmp.mapping.select_prev_item(),
+ ['<Tab>'] = cmp.mapping.select_next_item(),
+ ['<C-d>'] = cmp.mapping.scroll_docs(-4),
+ ['<C-u>'] = cmp.mapping.scroll_docs(4),
+ ['<C-Space>'] = cmp.mapping.complete(),
+ ['<C-e>'] = cmp.mapping.close(),
+ ['<CR>'] = cmp.mapping.confirm({
+ behavior = cmp.ConfirmBehavior.Replace,
+ select = true,
+ })
+ },
+ formatting = {
+ format = function(entry, vim_item)
+ -- fancy icons and a name of kind
+ vim_item.kind = require("lspkind").presets.default[vim_item.kind]
+ -- set a name for each source
+ vim_item.menu = ({
+ buffer = "[Buff]",
+ nvim_lsp = "[LSP]",
+ luasnip = "[LuaSnip]",
+ nvim_lua = "[Lua]",
+ latex_symbols = "[Latex]"
+ })[entry.source.name]
+ return vim_item
+ end
+ },
+ sources = {
+ {name = 'nvim_lsp'},
+ {name = 'nvim_lua'},
+ {name = 'path'},
+ {name = 'luasnip'},
+ {name = 'buffer', keyword_length = 1},
+ {name = 'calc' }
+ },
+ experimental = {
+ -- ghost_text = true,
+ }
- ["<Tab>"] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_next_item()
- elseif luasnip.expand_or_jumpable() then
- luasnip.expand_or_jump()
- elseif has_words_before() then
- cmp.complete()
- else
- fallback()
- end
- end, {"i", "s"}),
+})
- ["<S-Tab>"] = cmp.mapping(function(fallback)
- if cmp.visible() then
- cmp.select_prev_item()
- elseif luasnip.jumpable(-1) then
- luasnip.jump(-1)
- else
- fallback()
- end
- end, {"i", "s"})
- }
-})
-- local luasnip = require("luasnip")
@@ -135,4 +116,4 @@ cmp.setup({
-- { name = 'nvim_lsp_signature_help' },
-- { name = 'calc' },
-- },
--- }) \ No newline at end of file
+-- })
diff --git a/nvim/lua/plugins/dap.lua b/nvim/lua/plugins/dap.lua
index 065cead..f49590e 100644
--- a/nvim/lua/plugins/dap.lua
+++ b/nvim/lua/plugins/dap.lua
@@ -1,20 +1,7 @@
-
-local dap = require("dap");
-
-dap.configurations.typescriptreact = { -- change to typescript if needed
- {
- type = "chrome",
- request = "attach",
- program = "${file}",
- cwd = vim.fn.getcwd(),
- sourceMaps = true,
- protocol = "inspector",
- port = 9222,
- webRoot = "${workspaceFolder}"
- }
-}
-
-require('dap.ext.vscode').load_launchjs()
+local status_ok, dap = pcall(require, "dap")
+if not status_ok then
+ return
+end
-- Debugpy
dap.adapters.python = {
@@ -93,3 +80,10 @@ dap.configurations.rust = dap.configurations.cpp
vim.cmd [[command! BreakpointToggle lua require('dap').toggle_breakpoint()]]
vim.cmd [[command! Debug lua require('dap').continue()]]
vim.cmd [[command! DapREPL lua require('dap').repl.open()]]
+
+local tele_status_ok, telescope = pcall(require, "telescope")
+if not tele_status_ok then
+ return
+end
+
+telescope.load_extension('dap') \ No newline at end of file
diff --git a/nvim/lua/plugins/git-blame.lua b/nvim/lua/plugins/git-blame.lua
new file mode 100644
index 0000000..f0bb678
--- /dev/null
+++ b/nvim/lua/plugins/git-blame.lua
@@ -0,0 +1,3 @@
+vim.g.gitblame_enabled = 0
+vim.g.gitblame_message_template = "<summary> • <date> • <author>"
+vim.g.gitblame_highlight_group = "LineNr" \ No newline at end of file
diff --git a/nvim/lua/plugins/git-worktree.lua b/nvim/lua/plugins/git-worktree.lua
index d34e41c..2bc8892 100644
--- a/nvim/lua/plugins/git-worktree.lua
+++ b/nvim/lua/plugins/git-worktree.lua
@@ -1,4 +1,14 @@
-require("git-worktree").setup({
+local status_ok, git_worktree = pcall(require, "git-worktree")
+if not status_ok then
+ return
+end
+
+git_worktree.setup({
})
+local status_ok, telescope = pcall(require, "telescope")
+if not status_ok then
+ return
+end
+
require("telescope").load_extension("git_worktree") \ No newline at end of file
diff --git a/nvim/lua/plugins/gitsigns.lua b/nvim/lua/plugins/gitsigns.lua
new file mode 100644
index 0000000..b3c944a
--- /dev/null
+++ b/nvim/lua/plugins/gitsigns.lua
@@ -0,0 +1,48 @@
+local status_ok, gitsigns = pcall(require, "gitsigns")
+if not status_ok then
+ return
+end
+
+gitsigns.setup {
+ signs = {
+ add = { hl = "GitSignsAdd", text = "▎", numhl = "GitSignsAddNr", linehl = "GitSignsAddLn" },
+ change = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
+ delete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
+ topdelete = { hl = "GitSignsDelete", text = "契", numhl = "GitSignsDeleteNr", linehl = "GitSignsDeleteLn" },
+ changedelete = { hl = "GitSignsChange", text = "▎", numhl = "GitSignsChangeNr", linehl = "GitSignsChangeLn" },
+ },
+ signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
+ numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
+ linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
+ word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
+ watch_gitdir = {
+ interval = 1000,
+ follow_files = true,
+ },
+ attach_to_untracked = true,
+ current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
+ current_line_blame_opts = {
+ virt_text = true,
+ virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
+ delay = 1000,
+ ignore_whitespace = false,
+ },
+ current_line_blame_formatter_opts = {
+ relative_time = false,
+ },
+ sign_priority = 6,
+ update_debounce = 100,
+ status_formatter = nil, -- Use default
+ max_file_length = 40000,
+ preview_config = {
+ -- Options passed to nvim_open_win
+ border = "rounded",
+ style = "minimal",
+ relative = "cursor",
+ row = 0,
+ col = 1,
+ },
+ yadm = {
+ enable = false,
+ },
+} \ No newline at end of file
diff --git a/nvim/lua/plugins/lsp-installer.lua b/nvim/lua/plugins/lsp-installer.lua
index da61bbc..199fd37 100644
--- a/nvim/lua/plugins/lsp-installer.lua
+++ b/nvim/lua/plugins/lsp-installer.lua
@@ -1,4 +1,7 @@
-local lsp_installer = require("nvim-lsp-installer")
+local status_ok, lsp_installer = pcall(require, "nvim-lsp-installer")
+if not status_ok then
+ print("Failed to require nvim-lsp-installer")
+end
-- Provide settings first!
lsp_installer.settings {
diff --git a/nvim/lua/plugins/lsp-signature.lua b/nvim/lua/plugins/lsp-signature.lua
new file mode 100644
index 0000000..084913c
--- /dev/null
+++ b/nvim/lua/plugins/lsp-signature.lua
@@ -0,0 +1,59 @@
+local status_ok, signature = pcall(require, "lsp_signature")
+if not status_ok then
+ return
+end
+
+local icons = require "icons"
+
+local cfg = {
+ debug = false, -- set to true to enable debug logging
+ log_path = "debug_log_file_path", -- debug log path
+ verbose = false, -- show debug line number
+
+ bind = true, -- This is mandatory, otherwise border config won't get registered.
+ -- If you want to hook lspsaga or other signature handler, pls set to false
+ doc_lines = 0, -- will show two lines of comment/doc(if there are more than two lines in doc, will be truncated);
+ -- set to 0 if you DO NOT want any API comments be shown
+ -- This setting only take effect in insert mode, it does not affect signature help in normal
+ -- mode, 10 by default
+
+ floating_window = false, -- show hint in a floating window, set to false for virtual text only mode
+
+ floating_window_above_cur_line = true, -- try to place the floating above the current line when possible Note:
+ -- will set to true when fully tested, set to false will use whichever side has more space
+ -- this setting will be helpful if you do not want the PUM and floating win overlap
+ fix_pos = false, -- set to true, the floating window will not auto-close until finish all parameters
+ hint_enable = true, -- virtual hint enable
+ hint_prefix = icons.misc.Squirrel .. " ", -- Panda for parameter
+ hint_scheme = "Comment",
+ use_lspsaga = false, -- set to true if you want to use lspsaga popup
+ hi_parameter = "LspSignatureActiveParameter", -- how your parameter will be highlight
+ max_height = 12, -- max height of signature floating_window, if content is more than max_height, you can scroll down
+ -- to view the hiding contents
+ max_width = 120, -- max_width of signature floating_window, line will be wrapped if exceed max_width
+ handler_opts = {
+ border = "rounded", -- double, rounded, single, shadow, none
+ },
+
+ always_trigger = false, -- sometime show signature on new line or in middle of parameter can be confusing, set it to false for #58
+
+ auto_close_after = nil, -- autoclose signature float win after x sec, disabled if nil.
+ extra_trigger_chars = {}, -- Array of extra characters that will trigger signature completion, e.g., {"(", ","}
+ zindex = 200, -- by default it will be on top of all floating windows, set to <= 50 send it to bottom
+
+ padding = "", -- character to pad on left and right of signature can be ' ', or '|' etc
+
+ transparency = nil, -- disabled by default, allow floating win transparent value 1~100
+ shadow_blend = 36, -- if you using shadow as border use this set the opacity
+ shadow_guibg = "Black", -- if you using shadow as border use this set the color e.g. 'Green' or '#121315'
+ timer_interval = 200, -- default timer check interval set to lower value if you want to reduce latency
+ toggle_key = nil, -- toggle signature on and off in insert mode, e.g. toggle_key = '<M-x>'
+}
+
+-- recommanded:
+signature.setup(cfg) -- no need to specify bufnr if you don't use toggle_key
+
+-- You can also do this inside lsp on_attach
+-- note: on_attach deprecated
+-- require("lsp_signature").on_attach(cfg, bufnr) -- no need to specify bufnr if you don't use toggle_key
+signature.on_attach(cfg) -- no need to specify bufnr if you don't use toggle_key \ No newline at end of file
diff --git a/nvim/lua/plugins/lspconfig.lua b/nvim/lua/plugins/lspconfig.lua
index c10e1dc..0635ee8 100644
--- a/nvim/lua/plugins/lspconfig.lua
+++ b/nvim/lua/plugins/lspconfig.lua
@@ -1,3 +1,8 @@
+local status_ok, lspconfig = pcall(require, "lspconfig")
+if not status_ok then
+ return
+end
+
local capabilities = vim.lsp.protocol.make_client_capabilities()
capabilities.textDocument.completion.completionItem.snippetSupport = true
@@ -9,7 +14,7 @@ vim.lsp.handlers["textDocument/publishDiagnostics"] = vim.lsp.with(
virtual_text = {
true,
spacing = 6,
- --severity_limit='Error' -- Only show virtual text on error
+ severity_limit='Error' -- Only show virtual text on error
},
}
)
@@ -32,19 +37,11 @@ local function config(_config)
}, _config or {})
end
-require("lspconfig").tsserver.setup(config())
-
-require("lspconfig").ccls.setup(config())
-
-require("lspconfig").jedi_language_server.setup(config())
+lspconfig.tsserver.setup(config())
-require("lspconfig").svelte.setup(config())
+lspconfig.ccls.setup(config())
-require("lspconfig").solang.setup(config())
-
-require("lspconfig").cssls.setup(config())
-
-require("lspconfig").gopls.setup(config({
+lspconfig.gopls.setup(config({
cmd = { "gopls", "serve" },
settings = {
gopls = {
@@ -72,8 +69,11 @@ local rustopts = {
server = {
settings = {
["rust-analyzer"] = {
+ cargo = {
+ allFeatures = "true",
+ },
checkOnSave = {
- command = "clippy"
+ command = "clippy",
},
}
}
diff --git a/nvim/lua/plugins/lspkind.lua b/nvim/lua/plugins/lspkind.lua
index d2b437a..b33a24a 100644
--- a/nvim/lua/plugins/lspkind.lua
+++ b/nvim/lua/plugins/lspkind.lua
@@ -1,4 +1,9 @@
-require('lspkind').init({
+local status_ok, lspkind = pcall(require, "lspkind")
+if not status_ok then
+ return
+end
+
+lspkind.init({
-- enables text annotations (default: 'default')
-- default symbol map can be either 'default' or 'codicons' for codicon preset (requires vscode-codicons font installed)
preset = 'codicons',
diff --git a/nvim/lua/plugins/lspstatus.lua b/nvim/lua/plugins/lspstatus.lua
index ce34ab7..923209b 100644
--- a/nvim/lua/plugins/lspstatus.lua
+++ b/nvim/lua/plugins/lspstatus.lua
@@ -1,11 +1,12 @@
-require('lsp-status').status()
-require('lsp-status').register_progress()
-require('lsp-status').config({
- indicator_errors = '✗',
- indicator_warnings = '⚠',
- indicator_info = '',
- indicator_hint = '',
- indicator_ok = '✔',
+local lsp_status = require 'lsp-status'
+lsp_status.status()
+lsp_status.register_progress()
+lsp_status.config({
+ indicator_errors = "",
+ indicator_warnings = "",
+ indicator_info = "",
+ indicator_hint = "",
+ indicator_ok = "",
current_function = true,
update_interval = 100,
status_symbol = ' 🇻',
diff --git a/nvim/lua/plugins/lualine.lua b/nvim/lua/plugins/lualine.lua
index 825ae08..74db5b8 100644
--- a/nvim/lua/plugins/lualine.lua
+++ b/nvim/lua/plugins/lualine.lua
@@ -1,5 +1,113 @@
-require('lualine').setup {
- options = {
- theme = 'vscode'
- }
+local status_ok, lualine = pcall(require, "lualine")
+if not status_ok then
+ return
+end
+
+local status_gps_ok, gps = pcall(require, "nvim-gps")
+if not status_gps_ok then
+ return
+end
+
+local hide_in_width = function()
+ return vim.fn.winwidth(0) > 80
+end
+
+local icons = require 'icons'
+
+local diagnostics = {
+ "diagnostics",
+ sources = { "nvim_diagnostic" },
+ sections = { "error", "warn" },
+ symbols = { error = icons.diagnostics.Error .. " ", warn = icons.diagnostics.Warning .. " " },
+ colored = false,
+ update_in_insert = false,
+ always_visible = true,
+}
+
+local diff = {
+ "diff",
+ colored = false,
+ symbols = { added = icons.git.Add .. " ", modified = icons.git.Mod .. " ", removed = icons.git.Remove .. " " }, -- changes diff symbols
+ cond = hide_in_width,
+}
+
+local mode = {
+ "mode",
+ fmt = function(str)
+ return "-- " .. str .. " --"
+ end,
+}
+
+local filetype = {
+ "filetype",
+ icons_enabled = false,
+ icon = nil,
}
+
+local branch = {
+ "branch",
+ icons_enabled = true,
+ icon = "",
+}
+
+local location = {
+ "location",
+ padding = 0,
+}
+
+-- cool function for progress
+local progress = function()
+ local current_line = vim.fn.line "."
+ local total_lines = vim.fn.line "$"
+ local chars = { "__", "▁▁", "▂▂", "▃▃", "▄▄", "▅▅", "▆▆", "▇▇", "██" }
+ local line_ratio = current_line / total_lines
+ local index = math.ceil(line_ratio * #chars)
+ return chars[index]
+end
+
+local spaces = function()
+ return "spaces: " .. vim.api.nvim_buf_get_option(0, "shiftwidth")
+end
+
+local nvim_gps = function()
+ local gps_location = gps.get_location()
+ if gps_location == "error" then
+ return ""
+ else
+ return gps.get_location()
+ end
+end
+
+lualine.setup {
+ options = {
+ icons_enabled = true,
+ theme = "vscode",
+ component_separators = { left = "", right = "" },
+ section_separators = { left = "", right = "" },
+ disabled_filetypes = { "alpha", "dashboard", "NvimTree", "Outline", "toggleterm" },
+ always_divide_middle = true,
+ },
+ sections = {
+ -- lualine_a = { branch, diagnostics },
+ lualine_a = { branch },
+ lualine_b = { diagnostics },
+ -- lualine_c = { _gps },
+ lualine_c = {
+ { nvim_gps, cond = hide_in_width },
+ },
+ -- lualine_x = { "encoding", "fileformat", "filetype" },
+ lualine_x = { diff, spaces, "encoding", filetype },
+ lualine_y = { location },
+ lualine_z = { progress },
+ },
+ inactive_sections = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_c = {},
+ lualine_x = { "location" },
+ lualine_y = {},
+ lualine_z = {},
+ },
+ tabline = {},
+ extensions = {},
+} \ No newline at end of file
diff --git a/nvim/lua/plugins/luasnip.lua b/nvim/lua/plugins/luasnip.lua
index 50c5457..962dc24 100644
--- a/nvim/lua/plugins/luasnip.lua
+++ b/nvim/lua/plugins/luasnip.lua
@@ -1,13 +1,18 @@
-require("luasnip").config.set_config({
+local status_ok, luasnip = pcall(require, "luasnip")
+if not status_ok then
+ return
+end
+
+luasnip.config.set_config({
history = true,
updateevents = "TextChanged,TextChangedI"
})
-require("luasnip").snippets = {all = {}, html = {}}
+luasnip.snippets = {all = {}, html = {}}
-require("luasnip").snippets.javascript = require("luasnip").snippets.html
-require("luasnip").snippets.javascriptreact = require("luasnip").snippets.html
-require("luasnip").snippets.typescriptreact = require("luasnip").snippets.html
-require("luasnip/loaders/from_vscode").load({include = {"html"}})
+luasnip.snippets.javascript = luasnip.snippets.html
+luasnip.snippets.javascriptreact = luasnip.snippets.html
+luasnip.snippets.typescriptreact = luasnip.snippets.html
+require("luasnip.loaders.from_vscode").load({include = {"html"}})
-require('luasnip/loaders/from_vscode').lazy_load() \ No newline at end of file
+require('luasnip.loaders.from_vscode').lazy_load() \ No newline at end of file
diff --git a/nvim/lua/plugins/neogit.lua b/nvim/lua/plugins/neogit.lua
index 5d2e47b..ad1f275 100644
--- a/nvim/lua/plugins/neogit.lua
+++ b/nvim/lua/plugins/neogit.lua
@@ -1 +1,6 @@
-require('neogit').setup {} \ No newline at end of file
+local status_ok, neogit = pcall(require, "neogit")
+if not status_ok then
+ return
+end
+
+neogit.setup {} \ No newline at end of file
diff --git a/nvim/lua/plugins/null-ls.lua b/nvim/lua/plugins/null-ls.lua
index 44ee62c..e3aa45f 100644
--- a/nvim/lua/plugins/null-ls.lua
+++ b/nvim/lua/plugins/null-ls.lua
@@ -1,12 +1,47 @@
-local null_ls = require("null-ls")
+local status_ok, null_ls = pcall(require, "null-ls")
+if not status_ok then
+ return
+end
+local code_actions = null_ls.builtins.code_actions
+local diagnostics = null_ls.builtins.diagnostics
local formatting = null_ls.builtins.formatting
null_ls.setup({
- sources = {
- formatting.prettier,
- formatting.black,
- formatting.stylua,
- formatting.rustfmt,
- },
-}) \ No newline at end of file
+ sources = {
+ -- Code Actions
+ code_actions.gitsigns,
+ -- code_actions.shellcheck,
+
+ -- Diagnostics
+ -- diagnostics.codespell,
+ -- diagnostics.luacheck,
+ -- diagnostics.markdownlint,
+ -- 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,
+ },
+})
diff --git a/nvim/lua/plugins/nvim-tree.lua b/nvim/lua/plugins/nvim-tree.lua
index c2499d8..2bab234 100644
--- a/nvim/lua/plugins/nvim-tree.lua
+++ b/nvim/lua/plugins/nvim-tree.lua
@@ -1,7 +1,111 @@
-require("nvim-tree").setup {
+local status_ok, nvim_tree = pcall(require, "nvim-tree")
+if not status_ok then
+ return
+end
+
+local config_status_ok, nvim_tree_config = pcall(require, "nvim-tree.config")
+if not config_status_ok then
+ return
+end
+
+local tree_cb = nvim_tree_config.nvim_tree_callback
+
+vim.g.nvim_tree_respect_buf_cwd = 1
+vim.g.nvim_tree_icons = {
+ default = "",
+ symlink = "",
git = {
+ unstaged = "",
+ staged = "S",
+ unmerged = "",
+ renamed = "➜",
+ deleted = "",
+ untracked = "U",
+ ignored = "◌",
+ },
+ folder = {
+ default = "",
+ open = "",
+ empty = "",
+ empty_open = "",
+ symlink = "",
+ },
+}
+
+nvim_tree.setup {
+ disable_netrw = true,
+ hijack_netrw = true,
+ open_on_setup = false,
+ ignore_ft_on_setup = {
+ "startify",
+ "dashboard",
+ "alpha",
+ },
+ auto_close = true,
+ open_on_tab = false,
+ hijack_cursor = false,
+ update_cwd = true,
+ update_to_buf_dir = {
enable = true,
- ignore = false,
- timeout = 500
- }
+ auto_open = true,
+ },
+ diagnostics = {
+ enable = true,
+ icons = {
+ hint = "",
+ info = "",
+ warning = "",
+ error = "",
+ },
+ },
+ update_focused_file = {
+ enable = true,
+ update_cwd = true,
+ ignore_list = {},
+ },
+ system_open = {
+ cmd = nil,
+ args = {},
+ },
+ filters = {
+ dotfiles = false,
+ custom = {},
+ },
+ git = {
+ enable = true,
+ ignore = true,
+ timeout = 500,
+ },
+ view = {
+ width = 30,
+ height = 30,
+ hide_root_folder = false,
+ side = "left",
+ auto_resize = true,
+ mappings = {
+ custom_only = false,
+ list = {
+ { key = { "l", "<CR>", "o" }, cb = tree_cb "edit" },
+ { key = "h", cb = tree_cb "close_node" },
+ { key = "v", cb = tree_cb "vsplit" },
+ },
+ },
+ number = false,
+ relativenumber = false,
+ },
+ trash = {
+ cmd = "trash",
+ require_confirm = true,
+ },
+ quit_on_open = 0,
+ git_hl = 1,
+ disable_window_picker = 0,
+ root_folder_modifier = ":t",
+ show_icons = {
+ git = 1,
+ folders = 1,
+ files = 1,
+ folder_arrows = 1,
+ tree_width = 30,
+ },
} \ No newline at end of file
diff --git a/nvim/lua/plugins/project.lua b/nvim/lua/plugins/project.lua
new file mode 100644
index 0000000..810d2bd
--- /dev/null
+++ b/nvim/lua/plugins/project.lua
@@ -0,0 +1,13 @@
+local status_ok, project = pcall(require, "project_nvim")
+if not status_ok then
+ return
+end
+
+project.setup {}
+
+local tele_status_ok, telescope = pcall(require, "telescope")
+if not tele_status_ok then
+ return
+end
+
+telescope.load_extension('projects') \ No newline at end of file
diff --git a/nvim/lua/plugins/renamer.lua b/nvim/lua/plugins/renamer.lua
new file mode 100644
index 0000000..2db1899
--- /dev/null
+++ b/nvim/lua/plugins/renamer.lua
@@ -0,0 +1,46 @@
+local status_ok, renamer = pcall(require, "renamer")
+if not status_ok then
+ return
+end
+
+vim.api.nvim_set_keymap(
+ "i",
+ "<F2>",
+ '<cmd>lua require("renamer").rename({empty = true})<cr>',
+ { noremap = true, silent = true }
+)
+vim.api.nvim_set_keymap(
+ "n",
+ "<F2>",
+ '<cmd>lua require("renamer").rename({empty = true})<cr>',
+ { noremap = true, silent = true }
+)
+local mappings_utils = require("renamer.mappings.utils")
+renamer.setup({
+ -- The popup title, shown if `border` is true
+ title = "Rename",
+ -- The padding around the popup content
+ padding = {
+ top = 0,
+ left = 0,
+ bottom = 0,
+ right = 0,
+ },
+ -- Whether or not to shown a border around the popup
+ border = true,
+ -- The characters which make up the border
+ border_chars = { "─", "│", "─", "│", "╭", "╮", "╯", "╰" },
+ -- Whether or not to highlight the current word references through LSP
+ show_refs = true,
+ -- The keymaps available while in the `renamer` buffer. The example below
+ -- overrides the default values, but you can add others as well.
+ mappings = {
+ ["<c-i>"] = mappings_utils.set_cursor_to_start,
+ ["<c-a>"] = mappings_utils.set_cursor_to_end,
+ ["<c-e>"] = mappings_utils.set_cursor_to_word_end,
+ ["<c-b>"] = mappings_utils.set_cursor_to_word_start,
+ ["<c-c>"] = mappings_utils.clear_line,
+ ["<c-u>"] = mappings_utils.undo,
+ ["<c-r>"] = mappings_utils.redo,
+ },
+}) \ No newline at end of file
diff --git a/nvim/lua/plugins/session_manager.lua b/nvim/lua/plugins/session_manager.lua
new file mode 100644
index 0000000..736e69a
--- /dev/null
+++ b/nvim/lua/plugins/session_manager.lua
@@ -0,0 +1,25 @@
+local status_ok, session_manager = pcall(require, "session_manager")
+if not status_ok then
+ return
+end
+
+local status_ok, config = pcall(require, "session_manager.config")
+if not status_ok then
+ return
+end
+
+-- local Path = require('plenary.path')
+session_manager.setup({
+ autoload_mode = config.AutoloadMode.CurrentDir, -- Define what to do when Neovim is started without arguments. Possible values: Disabled, CurrentDir, LastSession
+ autosave_last_session = false, -- Automatically save last session on exit.
+})
+
+local tele_status_ok, telescope = pcall(require, "telescope")
+if not tele_status_ok then
+ return
+end
+
+local tele_session_status_ok, telescope = pcall(telescope.load_extension, "sessions")
+if not tele_session_status_ok then
+ return
+end \ No newline at end of file
diff --git a/nvim/lua/plugins/telescope.lua b/nvim/lua/plugins/telescope.lua
index d26a4c7..4376f76 100644
--- a/nvim/lua/plugins/telescope.lua
+++ b/nvim/lua/plugins/telescope.lua
@@ -1,4 +1,9 @@
-require('telescope').setup {
+local status_ok, telescope = pcall(require, "telescope")
+if not status_ok then
+ return
+end
+
+telescope.setup {
defaults = {
file_ignore_patterns = {"node_modules", ".git", "dist"},
vimgrep_arguments = {
@@ -46,6 +51,5 @@ require('telescope').setup {
}
-- Extensions
-require('telescope').load_extension('frecency')
-require('telescope').load_extension('fzf')
-require('telescope').load_extension('dap')
+telescope.load_extension('frecency')
+telescope.load_extension('fzf')
diff --git a/nvim/lua/plugins/treesitter.lua b/nvim/lua/plugins/treesitter.lua
index 826693a..95c1aea 100644
--- a/nvim/lua/plugins/treesitter.lua
+++ b/nvim/lua/plugins/treesitter.lua
@@ -1,4 +1,9 @@
-require("nvim-treesitter.configs").setup {
+local status_ok, treesitter = pcall(require, "nvim-treesitter.configs")
+if not status_ok then
+ return
+end
+
+treesitter.setup {
indent = {
enable = true
},
diff --git a/nvim/lua/plugins/which-key.lua b/nvim/lua/plugins/which-key.lua
new file mode 100644
index 0000000..b30fd4d
--- /dev/null
+++ b/nvim/lua/plugins/which-key.lua
@@ -0,0 +1,34 @@
+local status_ok, which_key = pcall(require, "which-key")
+if not status_ok then
+ return
+end
+
+local setup = {
+ plugins = {
+ spelling = {
+ enabled = true, -- enabling this will show WhichKey when pressing z= to select spelling suggestions
+ suggestions = 20, -- how many suggestions should be shown in the list?
+ },
+ },
+ window = {
+ border = "rounded", -- none, single, double, shadow
+ position = "bottom", -- bottom, top
+ margin = { 1, 0, 1, 0 }, -- extra window margin [top, right, bottom, left]
+ padding = { 2, 2, 2, 2 }, -- extra window padding [top, right, bottom, left]
+ winblend = 0,
+ },
+ layout = {
+ height = { min = 4, max = 25 }, -- min and max height of the columns
+ width = { min = 20, max = 50 }, -- min and max width of the columns
+ spacing = 3, -- spacing between columns
+ align = "center", -- align columns left, center or right
+ },
+}
+local opts = {
+ 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
+}
+
+which_key.setup(setup) \ No newline at end of file