Slowly reimplementing in a cleaner way
using this tutorial: https://www.youtube.com/watch?v=SxuwQJ0JHMU
This commit is contained in:
parent
f55fe434be
commit
7ce708971d
26 changed files with 225 additions and 709 deletions
5
init.lua
5
init.lua
|
|
@ -1,3 +1,2 @@
|
|||
require("core.defaults")
|
||||
require("core.plugins")
|
||||
require("core.plugin_config")
|
||||
require("defaults")
|
||||
require("lazy-bootstrap")
|
||||
|
|
|
|||
|
|
@ -1,37 +1,17 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "5a1e39223db9a0498024a77b8441169d260c8c25" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"darklight.nvim": { "branch": "main", "commit": "5db97e2d132ebdf32c7e5edb5b0c68be9ae43038" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "4516612fe98ff56ae0415a259ff6361a89419b0a" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "5e0a460d8e0f7f669c158dedd5f9ae2bcac31437" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "005b56001b2cb30bfa61b7986bc50657816ba4ba" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"lazygit.nvim": { "branch": "main", "commit": "a04ad0dbc725134edbee3a5eea29290976695357" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "561126520034a1dac2f78ab063db025d12555998" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "47f91c416daef12db467145e16bed5bbfe00add8" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "4cfe411526a7a99c18281135e8b4765ae6330d15" },
|
||||
"mason-nvim-dap.nvim": { "branch": "main", "commit": "9a10e096703966335bd5c46c8c875d5b0690dade" },
|
||||
"mason.nvim": { "branch": "main", "commit": "57e5a8addb8c71fb063ee4acda466c7cf6ad2800" },
|
||||
"mini.animate": { "branch": "main", "commit": "0365de8b69331c25d0d0d7573407a7dc7719e578" },
|
||||
"mini.starter": { "branch": "main", "commit": "8ee6ce6a4c9be47682516908557cc062c4d595a2" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "c2a0dd0d931d0fb07665e1fedb1ea688da3b80b4" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "85bbfad83f804f11688d1ab9486b459e699292d6" },
|
||||
"nvim-dap": { "branch": "master", "commit": "7bb46cc612bb127d7b0e3e9ed695267d830824ec" },
|
||||
"nvim-dap-ui": { "branch": "master", "commit": "cf91d5e2d07c72903d052f5207511bf7ecdb7122" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "ac04ec3c2af08e9821b4eb64ede86072b9b213bf" },
|
||||
"nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "b8b44b6a2494d086a9177251a119f9daec6cace8" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "433779916223596dce3ea64f4b77300c3aa2bfdc" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "6788013bb9cb784e606ada44206b0e755e4323d7" },
|
||||
"obsidian-todo.nvim": { "branch": "main", "commit": "33466086a82fc24e43df81b38a1593a49ee990c1" },
|
||||
"obsidian.nvim": { "branch": "main", "commit": "ae1f76a75c7ce36866e1d9342a8f6f5b9c2caf9b" },
|
||||
"org-bullets.nvim": { "branch": "main", "commit": "21437cfa99c70f2c18977bffd423f912a7b832ea" },
|
||||
"org-roam.nvim": { "branch": "main", "commit": "cf00a0b3797ee3370c2ca2bdedbc04b2f5309a1e" },
|
||||
"orgmode": { "branch": "master", "commit": "cf75da1a91071c6c041075eae4ca2326f9d1f52a" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a324581a3c83fdacdb9804b79de1cbe00ce18550" },
|
||||
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||
"neo-tree.nvim": { "branch": "v3.x", "commit": "9d6826582a3e8c84787bd7355df22a2812a1ad59" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-lsp-file-operations": { "branch": "master", "commit": "b9c795d3973e8eec22706af14959bc60c579e771" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "ead0f5f342d8d323441e7d4b88f0fc436a81ad5f" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "cb2cb74f3c3cbbcc17e79cada2060165d616d849" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "737cf6c657898d0c697311d79d361288a1343d50" },
|
||||
"nvim-window-picker": { "branch": "main", "commit": "6382540b2ae5de6c793d4aa2e3fe6dbb518505ec" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "3333a52ff548ba0a68af6d8da1e54f9cd96e9179" },
|
||||
"todo-comments.nvim": { "branch": "main", "commit": "31e3c38ce9b29781e4422fc0322eb0a21f4e8668" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "9a88eae817ef395952e08650b3283726786fb5fb" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "3aab2147e74890957785941f0c1ad87d0a44c15a" }
|
||||
"telescope-ui-select.nvim": { "branch": "master", "commit": "6e51d7da30bd139a6950adf2a47fda6df9fa06d2" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "5255aa27c422de944791318024167ad5d40aad20" }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,55 +0,0 @@
|
|||
local has_words_before = function()
|
||||
unpack = unpack or table.unpack
|
||||
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):match("%s") == nil
|
||||
end
|
||||
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
-- friendly snippets
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-o>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
-- You could replace the expand_or_jumpable() calls with expand_or_locally_jumpable()
|
||||
-- they way you will only jump inside the snippet region
|
||||
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" }),
|
||||
}),
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
}),
|
||||
})
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
local dap, dapui = require("dap"), require("dapui")
|
||||
dapui.setup();
|
||||
dap.listeners.before.attach.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.launch.dapui_config = function()
|
||||
dapui.open()
|
||||
end
|
||||
dap.listeners.before.event_terminated.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
dap.listeners.before.event_exited.dapui_config = function()
|
||||
dapui.close()
|
||||
end
|
||||
|
||||
-- C/C++/Rust (via gdb)
|
||||
dap.adapters.gdb = {
|
||||
type = "executable",
|
||||
command = "gdb",
|
||||
args = { "--interpreter=dap", "--eval-command", "set print pretty on" }
|
||||
}
|
||||
|
||||
dap.configurations.c = {
|
||||
{
|
||||
name = "Launch",
|
||||
type = "gdb",
|
||||
request = "launch",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = "${workspaceFolder}",
|
||||
stopAtBeginningOfMainSubprogram = false,
|
||||
},
|
||||
{
|
||||
name = "Select and attach to process",
|
||||
type = "gdb",
|
||||
request = "attach",
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
pid = function()
|
||||
local name = vim.fn.input('Executable name (filter): ')
|
||||
return require("dap.utils").pick_process({ filter = name })
|
||||
end,
|
||||
cwd = '${workspaceFolder}'
|
||||
},
|
||||
{
|
||||
name = 'Attach to gdbserver :1234',
|
||||
type = 'gdb',
|
||||
request = 'attach',
|
||||
target = 'localhost:1234',
|
||||
program = function()
|
||||
return vim.fn.input('Path to executable: ', vim.fn.getcwd() .. '/', 'file')
|
||||
end,
|
||||
cwd = '${workspaceFolder}'
|
||||
},
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
require('darklight').setup({
|
||||
mode = 'custom', -- Sets darklight to custom mode
|
||||
light_mode_callback = function() -- Function to call to set light mode
|
||||
vim.opt.background="light"
|
||||
end,
|
||||
dark_mode_callback = function() -- Function to call to set dark mode
|
||||
vim.opt.background="dark"
|
||||
end,
|
||||
})
|
||||
|
|
@ -1,24 +0,0 @@
|
|||
require("gruvbox").setup({
|
||||
terminal_colors = true, -- add neovim terminal colors
|
||||
undercurl = true,
|
||||
underline = true,
|
||||
bold = true,
|
||||
italic = {
|
||||
strings = true,
|
||||
emphasis = true,
|
||||
comments = true,
|
||||
operators = false,
|
||||
folds = true,
|
||||
},
|
||||
strikethrough = true,
|
||||
invert_selection = false,
|
||||
invert_signs = false,
|
||||
invert_tabline = false,
|
||||
invert_intend_guides = false,
|
||||
inverse = true, -- invert background for search, diffs, statuslines and errors
|
||||
contrast = "hard", -- can be "hard", "soft" or empty string
|
||||
overrides = {},
|
||||
dim_inactive = false,
|
||||
transparent_mode = false,
|
||||
})
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
require("ibl").setup {
|
||||
-- for example, context is off by default, use this to turn it on
|
||||
--show_current_context = false,
|
||||
--show_current_context_start = false,
|
||||
}
|
||||
vim.cmd [[colorscheme gruvbox]]
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
require("core.plugin_config.gruvbox")
|
||||
require("core.plugin_config.lualine")
|
||||
require("core.plugin_config.nvim-tree")
|
||||
require("core.plugin_config.telescope")
|
||||
require("core.plugin_config.terminal")
|
||||
require("core.plugin_config.indent-blankline")
|
||||
require("core.plugin_config.org")
|
||||
require("core.plugin_config.darklight")
|
||||
require("core.plugin_config.obsidian")
|
||||
require("core.plugin_config.treesitter")
|
||||
require("core.plugin_config.lsp_config")
|
||||
require("core.plugin_config.completions")
|
||||
require("core.plugin_config.whichkey")
|
||||
require("core.plugin_config.dap-debug")
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
require("mason").setup()
|
||||
require("mason-lspconfig").setup({
|
||||
automatic_enable = true,
|
||||
})
|
||||
-- gloabal mappings
|
||||
vim.keymap.set('n', '<leader>le', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '<leader>ln', vim.diagnostic.goto_next)
|
||||
vim.keymap.set('n', '<leader>lN', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', '<leader>lj', vim.diagnostic.setloclist)
|
||||
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
vim.keymap.set('n', '<leader>lD', vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set('n', '<leader>ld', vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set('n', '<leader>lk', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', '<leader>li', vim.lsp.buf.implementation, opts)
|
||||
--vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
--vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
--vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
--vim.keymap.set('n', '<space>wl', function()
|
||||
-- print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
--end, opts)
|
||||
vim.keymap.set('n', '<leader>lt', vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set('n', '<leader>lR', vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>la', vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set('n', '<leader>lr', vim.lsp.buf.references, opts)
|
||||
vim.keymap.set('n', '<space>lf', function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
|
||||
-- Attach lsp to completion engine
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities()
|
||||
|
||||
vim.lsp.config.lua_ls.settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
-- Get the language server to recognize the `vim` global
|
||||
globals = {
|
||||
'vim',
|
||||
'require'
|
||||
},
|
||||
},
|
||||
workspace = {
|
||||
-- Make the server aware of Neovim runtime files
|
||||
library = vim.api.nvim_get_runtime_file("", true),
|
||||
checkThirdParty = false,
|
||||
},
|
||||
-- Do not send telemetry data containing a randomized but unique identifier
|
||||
telemetry = {
|
||||
enable = false,
|
||||
},
|
||||
},
|
||||
}
|
||||
vim.lsp.config.lua_ls.capabilities = capabilities
|
||||
vim.lsp.config.clangd.capabilities = capabilities
|
||||
vim.lsp.config.cmake.capabilities = capabilities
|
||||
vim.lsp.config.ltex.capabilities = capabilities
|
||||
vim.lsp.config.ltex.settings = { ltex = { language = "en-GB" } }
|
||||
vim.lsp.config.ts_ls.capabilities = capabilities
|
||||
vim.lsp.config.jsonls.capabilities = capabilities
|
||||
vim.lsp.config.rust_analyzer.capabilities = capabilities
|
||||
vim.lsp.config.taplo.capabilities = capabilities
|
||||
vim.lsp.config.zls.capabilities = capabilities
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
require('lualine').setup {
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'gruvbox',
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {
|
||||
{
|
||||
'filename',
|
||||
file_status = true, -- displays file status (readonly status, modified status)
|
||||
path = 1 -- 0 = just filename, 1 = relative path, 2 = absolute path
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
-- disable netrw at the very start of your init.lua
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- set termguicolors to enable highlight groups
|
||||
vim.opt.termguicolors = true
|
||||
|
||||
-- empty setup using defaults
|
||||
require("nvim-tree").setup()
|
||||
|
||||
-- keymap
|
||||
vim.keymap.set("n", "<leader>s", ':NvimTreeFindFileToggle<CR>')
|
||||
|
|
@ -1,47 +0,0 @@
|
|||
local vaultLocation = "$HOME/Sync/wiki"
|
||||
require("obsidian").setup({
|
||||
workspaces = {
|
||||
{
|
||||
name = "vault",
|
||||
path = vaultLocation,
|
||||
},
|
||||
},
|
||||
completion = {
|
||||
-- Set to false to disable completion.
|
||||
nvim_cmp = true,
|
||||
},
|
||||
templates = {
|
||||
subdir = "Templates",
|
||||
-- A map for custom variables, the key should be the variable and the value a function
|
||||
substitutions = {},
|
||||
},
|
||||
daily_notes = {
|
||||
-- Optional, if you keep daily notes in a separate directory.
|
||||
folder = "diary",
|
||||
-- Optional, if you want to automatically insert a template from your template directory like 'daily.md'
|
||||
template = "daily_note.md"
|
||||
},
|
||||
note_id_func = function(title)
|
||||
local suffix = ""
|
||||
if title ~= nil then
|
||||
-- If title is given, transform it into valid file name.
|
||||
suffix = title:gsub(" ", "-"):gsub("[^A-Za-z0-9-]", ""):lower()
|
||||
else
|
||||
-- If title is nil, just add 4 random uppercase letters to the suffix.
|
||||
for _ = 1, 4 do
|
||||
suffix = suffix .. string.char(math.random(65, 90))
|
||||
end
|
||||
end
|
||||
return suffix
|
||||
end,
|
||||
})
|
||||
|
||||
-- for obsidian-todo.nvim
|
||||
require("telescope").setup({
|
||||
extensions = {
|
||||
obsidian_todo = {
|
||||
search_path = vaultLocation,
|
||||
search_pattern = "- [ ] #todo",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
@ -1,73 +0,0 @@
|
|||
-- Treesitter configuration
|
||||
--require('nvim-treesitter.configs').setup({
|
||||
-- -- If TS highlights are not enabled at all, or disabled via `disable` prop,
|
||||
-- -- highlighting will fallback to default Vim syntax highlighting
|
||||
-- highlight = {
|
||||
-- enable = true,
|
||||
-- -- Required for spellcheck, some LaTex highlights and
|
||||
-- -- code block highlights that do not have ts grammar
|
||||
-- additional_vim_regex_highlighting = { 'org' },
|
||||
-- },
|
||||
-- ensure_installed = { 'org' }, -- Or run :TSUpdate org
|
||||
--})
|
||||
|
||||
require('orgmode').setup({
|
||||
org_agenda_files = { '~/Sync/wiki/org/**/*.org' },
|
||||
org_default_notes_file = '~/Sync/wiki/org/refile.org',
|
||||
org_todo_keywords = { 'TODO(t)', 'NEXT(n)', '|', 'HOLD(h)', 'DONE(d)' }
|
||||
})
|
||||
|
||||
|
||||
require('cmp').setup({
|
||||
sources = {
|
||||
{ name = 'orgmode' }
|
||||
}
|
||||
})
|
||||
|
||||
require('org-bullets').setup()
|
||||
|
||||
require("org-roam").setup({
|
||||
directory = "~/Sync/wiki/org/roam/",
|
||||
--org_files = {
|
||||
-- "~/another_org_dir",
|
||||
-- "~/some/folder/*.org",
|
||||
-- "~/a/single/org_file.org",
|
||||
--}
|
||||
templates = {
|
||||
d = {
|
||||
description = "default",
|
||||
template = "%?",
|
||||
target = "%<%Y%m%d%H%M%S>-%[slug].org",
|
||||
},
|
||||
f = {
|
||||
description = "fleeting",
|
||||
template = "#+filetags: fleeting\n\n%?",
|
||||
target = "fleeting%[sep]%<%Y%m%d%H%M%S>-%[slug].org",
|
||||
},
|
||||
l = {
|
||||
description = "literature",
|
||||
template = "#+filetags: literature\n\n* %?\n** Description\n\n** Notes\n - pg 1: ",
|
||||
target = "literature%[sep]%<%Y%m%d%H%M%S>-%[slug].org",
|
||||
},
|
||||
r = {
|
||||
description = "reference",
|
||||
template = "#+filetags: reference\n\n* %?\n** Description\n\n** Notes\n - pg 1: ",
|
||||
target = "reference%[sep]%<%Y%m%d%H%M%S>-%[slug].org",
|
||||
},
|
||||
m = {
|
||||
description = "main",
|
||||
template = "%?",
|
||||
target = "%<%Y%m%d%H%M%S>-%[slug].org",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
-- Automatic line wrapping
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "org",
|
||||
callback = function()
|
||||
vim.opt_local.textwidth = 80
|
||||
vim.opt_local.wrap = true
|
||||
vim.opt_local.linebreak = true
|
||||
end,
|
||||
})
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
local builtin = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fo', builtin.oldfiles, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
require("toggleterm").setup({
|
||||
hide_numbers = true,
|
||||
start_in_insert = true,
|
||||
shell = vim.o.shell,
|
||||
})
|
||||
|
||||
-- Get out of terminal!
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = {buffer = 0}
|
||||
vim.keymap.set('t', '<leader><esc>', [[<C-\><C-n>]], opts)
|
||||
vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
|
||||
end
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
|
||||
-- Open terminal keymap
|
||||
vim.keymap.set('n', '<leader>t', ":ToggleTerm<CR>",{noremap = true, silent = true})
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
require('nvim-treesitter').install({ 'stable' })
|
||||
require('nvim-treesitter').update()
|
||||
|
||||
-- Auto launch for every TSInstalled filetype
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = require('nvim-treesitter').get_installed(),
|
||||
callback = function(event)
|
||||
-- syntax highlighting, provided by Neovim
|
||||
vim.treesitter.start()
|
||||
-- Use regex highlighting as well as tree-sitter
|
||||
vim.bo.syntax = event.match
|
||||
-- folds, provided by Neovim
|
||||
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
vim.wo.foldmethod = 'expr'
|
||||
-- indentation, provided by nvim-treesitter
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
|
|
@ -1,91 +0,0 @@
|
|||
local whichkey = require("which-key")
|
||||
|
||||
local keymap = {
|
||||
{ "<leader>T", group = "todo" },
|
||||
{ "<leader>TN", function() require("todo-comments").jump_prev() end, desc = "Jump to previous TODO:" },
|
||||
{ "<leader>TT", "<Cmd>TodoTelescope<CR>", desc = "Search TODO:'s" },
|
||||
{ "<leader>Tj", "<Cmd>TodoLocList<CR>", desc = "List TODO:'s in buffer" },
|
||||
{ "<leader>Tn", function() require("todo-comments").jump_next() end, desc = "Jump to next TODO:" },
|
||||
{ "<leader>d", group = "DAP debug tools" },
|
||||
{ "<leader>dc", function() require('dap').continue() end, desc = "continue/launch" },
|
||||
{ "<leader>db", function() require('dap').toggle_breakpoint() end, desc = "toggle breakpoint" },
|
||||
{ "<leader>di", function() require('dap').step_into() end, desc = "step into" },
|
||||
{ "<leader>do", function() require('dap').step_over() end, desc = "step over" },
|
||||
{ "<leader>dO", function() require('dap').step_out() end, desc = "step over" },
|
||||
{ "<leader>f", group = "find (telescope)" },
|
||||
{ "<leader>ff", "<cmd>Telescope find_files<CR>", desc = "Find" },
|
||||
{ "<leader>fg", "<cmd>Telescope live_grep<CR>", desc = "Grep" },
|
||||
{ "<leader>fh", "<cmd>Telescope help_tags<CR>", desc = "Help Tags" },
|
||||
{ "<leader>fo", "<cmd>Telescope oldfiles<CR>", desc = "Old Files" },
|
||||
{ "<leader>g", group = "git" },
|
||||
{ "<leader>gb", "<Cmd>Telescope git_branches<CR>", desc = "Branches" },
|
||||
{ "<leader>gg", "<Cmd>Telescope git_commits<CR>", desc = "LazyGit" },
|
||||
{ "<leader>gl", "<Cmd>LazyGit<CR>", desc = "Commits" },
|
||||
{ "<leader>gs", "<Cmd>Telescope git_status<CR>", desc = "Status" },
|
||||
{ "<leader>l", group = "lsp" },
|
||||
{ "<leader>lD", "<cmd>lua vim.lsp.buf.declaration()<cr>", desc = "Declaration" },
|
||||
{ "<leader>lN", "<cmd>lua vim.diagnostic.goto_prev()<cr>", desc = "Previous Diagnostic" },
|
||||
{ "<leader>lR", "<cmd>lua vim.lsp.buf.rename()<cr>", desc = "Rename" },
|
||||
{ "<leader>la", "<cmd>lua vim.lsp.buf.code_action()<cr>", desc = "Code Action" },
|
||||
{ "<leader>ld", "<cmd>lua vim.lsp.buf.definition()<cr>", desc = "Definition" },
|
||||
{ "<leader>le", "<cmd>lua vim.diagnostic.open_float()<cr>", desc = "Diagnostic Float" },
|
||||
{ "<leader>lf", function() vim.lsp.buf.format { async = true } end, desc = "Format" },
|
||||
{ "<leader>li", "<cmd>lua vim.lsp.buf.implementation()<cr>", desc = "Implementation" },
|
||||
{ "<leader>lj", "<cmd>lua vim.diagnostic.setloclist()<cr>", desc = "Diagnostic List" },
|
||||
{ "<leader>lk", "<cmd>lua vim.lsp.buf.hover()<cr>", desc = "Hover" },
|
||||
{ "<leader>ln", "<cmd>lua vim.diagnostic.goto_next()<cr>", desc = "Next Diagnostic" },
|
||||
{ "<leader>lr", "<cmd>lua vim.lsp.buf.references()<cr>", desc = "References" },
|
||||
{ "<leader>lt", "<cmd>lua vim.lsp.buf.type_definition()<cr>", desc = "Type Definition" },
|
||||
{ "<leader>m", "<Cmd>DarkLightSwitch<CR>", desc = "Toggle dark mode" },
|
||||
{ "<leader>o", group = "org mode" },
|
||||
{ "<leader>oI", "<Cmd>e ~/Sync/wiki/org<CR>", desc = "Open Org directory" },
|
||||
{ "<leader>t", desc = "Toggle Terminal" },
|
||||
{ "<leader>v", group = "obsidian Vault" },
|
||||
{ "<leader>vL", "<Cmd>ObsidianLinkNew<CR>", desc = "Link New Note from Current Selection" },
|
||||
{ "<leader>vT", "<Cmd>ObsidianTemplate<CR>", desc = "Open Template" },
|
||||
{ "<leader>vb", "<Cmd>ObsidianBacklinks<CR>", desc = "List Backlinks" },
|
||||
{ "<leader>vd", "<Cmd>ObsidianToday<CR>", desc = "Open Daily Note" },
|
||||
{ "<leader>vf", "<Cmd>ObsidianFollowLink<CR>", desc = "Follow Link" },
|
||||
{ "<leader>vi", "<Cmd>e ~/Sync/wiki/index.md<CR>", desc = "Open Index" },
|
||||
{ "<leader>vl", "<Cmd>ObsidianLink<CR>", desc = "Link Current Selection" },
|
||||
{ "<leader>vn", "<Cmd>ObsidianNew<CR>", desc = "New Note" },
|
||||
{ "<leader>vo", "<Cmd>ObsidianOpen<CR>", desc = "Obsidian Open" },
|
||||
{ "<leader>vp", "<Cmd>ObsidianPasteImg<CR>", desc = "Paste Image" },
|
||||
{ "<leader>vq", "<Cmd>ObsidianQuickSwitch<CR>", desc = "Quick Switch with fzf" },
|
||||
{ "<leader>vr", "<Cmd>ObsidianRename<CR>", desc = "Rename Note" },
|
||||
{ "<leader>vs", "<Cmd>ObsidianSearch<CR>", desc = "Search Notes" },
|
||||
{ "<leader>vT", "<Cmd>ObsidianTomorrow<CR>", desc = "Open Tomorrows Note" },
|
||||
{ "<leader>vt", "<Cmd>Telescope obsidian_todo obsidian_todo<CR>", desc = "Search for all TODOs" },
|
||||
{ "<leader>vw", "<Cmd>ObsidianWorkspace<CR>", desc = "Switch Workspace" },
|
||||
{ "<leader>vy", "<Cmd>ObsidianYesterday<CR>", desc = "Open Yesterdays Note" },
|
||||
{ "<leader>w", group = "window" },
|
||||
{ "<leader>w+", desc = "Increase height" },
|
||||
{ "<leader>w-", desc = "Decrease height" },
|
||||
{ "<leader>w<", desc = "Decrease width" },
|
||||
{ "<leader>w=", desc = "Equally high and wide" },
|
||||
{ "<leader>w>", desc = "Increase width" },
|
||||
{ "<leader>wT", desc = "Break out into a new tab" },
|
||||
{ "<leader>wh", desc = "Go to the left window" },
|
||||
{ "<leader>wj", desc = "Go to the down window" },
|
||||
{ "<leader>wk", desc = "Go to the up window" },
|
||||
{ "<leader>wl", desc = "Go to the right window" },
|
||||
{ "<leader>wq", desc = "Quit a window" },
|
||||
{ "<leader>ws", desc = "Split window" },
|
||||
{ "<leader>wv", desc = "Split window vertically" },
|
||||
{ "<leader>ww", desc = "Pick Window" },
|
||||
{ "<leader>wx", desc = "Swap current with next" },
|
||||
{ "<leader>w|", desc = "Max out the width" },
|
||||
}
|
||||
-- Map window keys to leader w
|
||||
vim.cmd [[nmap <leader>w <C-w>]]
|
||||
|
||||
whichkey.setup {
|
||||
hide_statusline = false,
|
||||
default_keymap_settings = {
|
||||
silent = true,
|
||||
noremap = true,
|
||||
},
|
||||
default_mode = 'n',
|
||||
}
|
||||
|
||||
whichkey.add(keymap)
|
||||
|
|
@ -1,158 +0,0 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
local plugins = {
|
||||
'folke/lazy.nvim',
|
||||
'ellisonleao/gruvbox.nvim',
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
'nvim-tree/nvim-web-devicons',
|
||||
'nvim-lualine/lualine.nvim',
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
opts = {} -- this is equalent to setup({}) function
|
||||
},
|
||||
'akinsho/toggleterm.nvim',
|
||||
-- keybind tooltip
|
||||
{
|
||||
"folke/which-key.nvim",
|
||||
event = "VeryLazy",
|
||||
init = function()
|
||||
vim.o.timeout = true
|
||||
vim.o.timeoutlen = 300
|
||||
end,
|
||||
},
|
||||
{ "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} },
|
||||
-- fzf
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
--branch = "0.1.x",
|
||||
dependencies = { { 'nvim-lua/plenary.nvim' } }
|
||||
},
|
||||
-- TODO
|
||||
{
|
||||
"folke/todo-comments.nvim",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {}
|
||||
},
|
||||
-- Lsp
|
||||
{
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
'neovim/nvim-lspconfig'
|
||||
},
|
||||
-- completion
|
||||
'hrsh7th/nvim-cmp',
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
{
|
||||
"L3MON4D3/LuaSnip",
|
||||
version = "2.*", -- Replace <CurrentMajor> by the latest released major
|
||||
-- install jsregexp (optional!).
|
||||
build = "make install_jsregexp"
|
||||
},
|
||||
'saadparwaiz1/cmp_luasnip',
|
||||
'rafamadriz/friendly-snippets',
|
||||
-- Org Mode
|
||||
{
|
||||
'nvim-orgmode/orgmode',
|
||||
dependencies = {
|
||||
{ 'nvim-treesitter/nvim-treesitter', lazy = true },
|
||||
},
|
||||
},
|
||||
{
|
||||
'akinsho/org-bullets.nvim',
|
||||
dependencies = { { 'nvim-orgmode/orgmode' } },
|
||||
},
|
||||
{
|
||||
"chipsenkbeil/org-roam.nvim",
|
||||
tag = "0.1.1",
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-orgmode/orgmode",
|
||||
--tag = "0.3.7",
|
||||
},
|
||||
},
|
||||
},
|
||||
-- Obsidian
|
||||
{
|
||||
"epwalsh/obsidian.nvim",
|
||||
version = "*",
|
||||
lazy = true,
|
||||
ft = "markdown",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
},
|
||||
},
|
||||
{
|
||||
"LilleAila/obsidian-todo.nvim",
|
||||
dependencies = { 'nvim-telescope/telescope.nvim' }
|
||||
},
|
||||
-- Lightmode switcher
|
||||
'eliseshaffer/darklight.nvim',
|
||||
-- Mini tools
|
||||
{
|
||||
'echasnovski/mini.animate',
|
||||
version = false,
|
||||
config = function()
|
||||
local animate = require('mini.animate')
|
||||
animate.setup({
|
||||
scroll = { timing = animate.gen_timing.linear({ duration = 50, unit = 'total' }) },
|
||||
cursor = { enable = false }
|
||||
})
|
||||
end
|
||||
|
||||
},
|
||||
{
|
||||
'echasnovski/mini.starter',
|
||||
version = false,
|
||||
config = function()
|
||||
require('mini.starter').setup()
|
||||
end
|
||||
|
||||
},
|
||||
-- Git tooling
|
||||
{
|
||||
"kdheepak/lazygit.nvim",
|
||||
cmd = {
|
||||
"LazyGit",
|
||||
"LazyGitConfig",
|
||||
"LazyGitCurrentFile",
|
||||
"LazyGitFilter",
|
||||
"LazyGitFilterCurrentFile",
|
||||
},
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
}
|
||||
},
|
||||
{
|
||||
"sindrets/diffview.nvim"
|
||||
},
|
||||
-- DAP Debugging Tools
|
||||
{
|
||||
"rcarriga/nvim-dap-ui",
|
||||
dependencies = {
|
||||
"mfussenegger/nvim-dap",
|
||||
"nvim-neotest/nvim-nio",
|
||||
"jay-babu/mason-nvim-dap.nvim"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
local opts = {}
|
||||
|
||||
require("lazy").setup(plugins, opts)
|
||||
35
lua/lazy-bootstrap.lua
Normal file
35
lua/lazy-bootstrap.lua
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
-- Bootstrap lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
if not (vim.uv or vim.loop).fs_stat(lazypath) then
|
||||
local lazyrepo = "https://github.com/folke/lazy.nvim.git"
|
||||
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
|
||||
if vim.v.shell_error ~= 0 then
|
||||
vim.api.nvim_echo({
|
||||
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" },
|
||||
{ out, "WarningMsg" },
|
||||
{ "\nPress any key to exit..." },
|
||||
}, true, {})
|
||||
vim.fn.getchar()
|
||||
os.exit(1)
|
||||
end
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
-- Make sure to setup `mapleader` and `maplocalleader` before
|
||||
-- loading lazy.nvim so that mappings are correct.
|
||||
-- This is also a good place to setup other settings (vim.opt)
|
||||
--vim.g.mapleader = " "
|
||||
--vim.g.maplocalleader = "\\"
|
||||
|
||||
-- Setup lazy.nvim
|
||||
require("lazy").setup({
|
||||
spec = {
|
||||
-- import your plugins
|
||||
{ import = "plugins" },
|
||||
},
|
||||
-- Configure any other settings here. See the documentation for more details.
|
||||
-- colorscheme that will be used when installing plugins.
|
||||
install = { colorscheme = { "habamax" } },
|
||||
-- automatically check for plugin updates
|
||||
checker = { enabled = true },
|
||||
})
|
||||
29
lua/plugins/gruvbox.lua
Normal file
29
lua/plugins/gruvbox.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
return {
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
config = function()
|
||||
require("gruvbox").setup({
|
||||
terminal_colors = true, -- add neovim terminal colors
|
||||
undercurl = true,
|
||||
underline = true,
|
||||
bold = true,
|
||||
italic = {
|
||||
strings = true,
|
||||
emphasis = true,
|
||||
comments = true,
|
||||
operators = false,
|
||||
folds = true,
|
||||
},
|
||||
strikethrough = true,
|
||||
invert_selection = false,
|
||||
invert_signs = false,
|
||||
invert_tabline = false,
|
||||
invert_intend_guides = false,
|
||||
inverse = true, -- invert background for search, diffs, statuslines and errors
|
||||
contrast = "hard", -- can be "hard", "soft" or empty string
|
||||
overrides = {},
|
||||
dim_inactive = false,
|
||||
transparent_mode = false,
|
||||
})
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
end
|
||||
}
|
||||
45
lua/plugins/lsp-config.lua
Normal file
45
lua/plugins/lsp-config.lua
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
return {
|
||||
"mason-org/mason-lspconfig.nvim",
|
||||
opts = {},
|
||||
dependencies = {
|
||||
{ "mason-org/mason.nvim", opts = {} },
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
vim.api.nvim_create_autocmd('LspAttach', {
|
||||
group = vim.api.nvim_create_augroup('UserLspConfig', {}),
|
||||
callback = function(ev)
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
|
||||
|
||||
-- Buffer local mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local opts = { buffer = ev.buf }
|
||||
vim.keymap.set('n', '<leader>le', vim.diagnostic.open_float)
|
||||
vim.keymap.set('n', '<leader>ln', vim.diagnostic.goto_next)
|
||||
vim.keymap.set('n', '<leader>lN', vim.diagnostic.goto_prev)
|
||||
vim.keymap.set('n', '<leader>lj', vim.diagnostic.setloclist)
|
||||
|
||||
vim.keymap.set('n', '<leader>lD', vim.lsp.buf.declaration, opts)
|
||||
vim.keymap.set('n', '<leader>ld', vim.lsp.buf.definition, opts)
|
||||
vim.keymap.set('n', '<leader>lk', vim.lsp.buf.hover, opts)
|
||||
vim.keymap.set('n', '<leader>li', vim.lsp.buf.implementation, opts)
|
||||
--vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
--vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
--vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
--vim.keymap.set('n', '<space>wl', function()
|
||||
-- print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
--end, opts)
|
||||
vim.keymap.set('n', '<leader>lt', vim.lsp.buf.type_definition, opts)
|
||||
vim.keymap.set('n', '<leader>lR', vim.lsp.buf.rename, opts)
|
||||
vim.keymap.set({ 'n', 'v' }, '<leader>la', vim.lsp.buf.code_action, opts)
|
||||
vim.keymap.set('n', '<leader>lr', vim.lsp.buf.references, opts)
|
||||
vim.keymap.set('n', '<space>lf', function()
|
||||
vim.lsp.buf.format { async = true }
|
||||
end, opts)
|
||||
end,
|
||||
})
|
||||
end
|
||||
},
|
||||
}
|
||||
}
|
||||
9
lua/plugins/lualine.lua
Normal file
9
lua/plugins/lualine.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require('lualine').setup {
|
||||
options = { theme = 'gruvbox' }
|
||||
}
|
||||
end
|
||||
}
|
||||
41
lua/plugins/neo-tree.lua
Normal file
41
lua/plugins/neo-tree.lua
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
return {
|
||||
{
|
||||
"nvim-neo-tree/neo-tree.nvim",
|
||||
branch = "v3.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"MunifTanjim/nui.nvim",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
},
|
||||
{
|
||||
"antosha417/nvim-lsp-file-operations",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
"nvim-neo-tree/neo-tree.nvim", -- makes sure that this loads after Neo-tree.
|
||||
},
|
||||
config = function()
|
||||
require("lsp-file-operations").setup()
|
||||
vim.keymap.set("n", "<leader>s", ':Neotree toggle<CR>')
|
||||
end,
|
||||
},
|
||||
{
|
||||
"s1n7ax/nvim-window-picker",
|
||||
version = "2.*",
|
||||
config = function()
|
||||
require("window-picker").setup({
|
||||
filter_rules = {
|
||||
include_current_win = false,
|
||||
autoselect_one = true,
|
||||
-- filter using buffer options
|
||||
bo = {
|
||||
-- if the file type is one of following, the window will be ignored
|
||||
filetype = { "neo-tree", "neo-tree-popup", "notify" },
|
||||
-- if the buffer type is one of following, the window will be ignored
|
||||
buftype = { "terminal", "quickfix" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
}
|
||||
29
lua/plugins/telescope.lua
Normal file
29
lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
return {
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
opts = {},
|
||||
config = function()
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>fo', builtin.oldfiles, {})
|
||||
vim.keymap.set('n', '<leader>fg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
||||
end
|
||||
},
|
||||
{
|
||||
'nvim-telescope/telescope-ui-select.nvim',
|
||||
config = function()
|
||||
require("telescope").setup {
|
||||
extensions = {
|
||||
["ui-select"] = {
|
||||
require("telescope.themes").get_dropdown {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
require("telescope").load_extension("ui-select")
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
22
lua/plugins/treesitter.lua
Normal file
22
lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
lazy = false,
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
-- Auto launch for every TSInstalled filetype
|
||||
vim.api.nvim_create_autocmd('FileType', {
|
||||
pattern = require('nvim-treesitter').get_installed(),
|
||||
callback = function(event)
|
||||
-- syntax highlighting, provided by Neovim
|
||||
vim.treesitter.start()
|
||||
-- Use regex highlighting as well as tree-sitter
|
||||
vim.bo.syntax = event.match
|
||||
-- folds, provided by Neovim
|
||||
vim.wo.foldexpr = 'v:lua.vim.treesitter.foldexpr()'
|
||||
vim.wo.foldmethod = 'expr'
|
||||
-- indentation, provided by nvim-treesitter
|
||||
vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()"
|
||||
end,
|
||||
})
|
||||
end
|
||||
}
|
||||
Loading…
Reference in a new issue