feat: initial commit
This commit is contained in:
8
nvim/README.md
Normal file
8
nvim/README.md
Normal file
@@ -0,0 +1,8 @@
|
||||
nodejs
|
||||
|
||||
clang
|
||||
|
||||
|
||||
:CocInstall coc-clangd
|
||||
|
||||
:CocCommand clangd.install
|
||||
28
nvim/init.lua
Executable file
28
nvim/init.lua
Executable file
@@ -0,0 +1,28 @@
|
||||
vim.g.mapleader = " "
|
||||
|
||||
|
||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system {
|
||||
'git',
|
||||
'clone',
|
||||
'--filter=blob:none',
|
||||
'https://github.com/folke/lazy.nvim.git',
|
||||
'--branch=stable', -- latest stable release
|
||||
lazypath,
|
||||
}
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup("plugins", {
|
||||
dev = {
|
||||
-- directory where you store your local plugin projects
|
||||
path = "~/lua/nvim-plugins",
|
||||
fallback = true, -- Fallback to git when local plugin doesn't exist
|
||||
},
|
||||
})
|
||||
|
||||
require("settings")
|
||||
require("mappings")
|
||||
require("setup")
|
||||
|
||||
37
nvim/lazy-lock.json
Normal file
37
nvim/lazy-lock.json
Normal file
@@ -0,0 +1,37 @@
|
||||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "dae4f5aaa3574bd0c2b9dd20fb9542a02c10471c" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "cbc7b02bb99fae35cb42f514762b89b5126651ef" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"gitlinker.nvim": { "branch": "master", "commit": "bbe2a1254fc8fce21f3bbf9a020266a1c49799f7" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "7c4faa3540d0781a28588cafbd4dd187a28ac6e3" },
|
||||
"harpoon": { "branch": "harpoon2", "commit": "87b1a3506211538f460786c23f98ec63ad9af4e5" },
|
||||
"indent-blankline.nvim": { "branch": "master", "commit": "d28a3f70721c79e3c5f6693057ae929f3d9c0a03" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "306a05526ada86a7b30af95c5cc81ffba93fef97" },
|
||||
"linediff.vim": { "branch": "main", "commit": "29fa617fc10307a1e0ae82a8761114e465d17b06" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "a676ab7282da8d651e175118bcf54483ca11e46d" },
|
||||
"mason.nvim": { "branch": "main", "commit": "44d1e90e1f66e077268191e3ee9d2ac97cc18e65" },
|
||||
"mini.files": { "branch": "main", "commit": "57eb96a828f80efb8095a611e3aafcfa43548f8b" },
|
||||
"neogen": { "branch": "main", "commit": "23e7e9f883d01289ebd90e98025acc860ea26366" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "59bce2eef357189c3305e25bc6dd2d138c1683f5" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "da88697d7f45d16852c6b2769dc52387d1ddc45f" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "dc2f86d2b66a6e01a98c37cdadd3be3e90f8ab9a" },
|
||||
"nvim-navic": { "branch": "master", "commit": "f5eba192f39b453675d115351808bd51276d9de5" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-treesitter-context": { "branch": "master", "commit": "9a8e39993e3b895601bf8227124a48ea8268149e" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "d7462543c9e366c0d196c7f67a945eaaf5d99414" },
|
||||
"onedark.nvim": { "branch": "master", "commit": "213c23ae45a04797572242568d5d51937181792d" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"rust-tools.nvim": { "branch": "master", "commit": "676187908a1ce35ffcd727c654ed68d851299d3e" },
|
||||
"telescope-file-browser.nvim": { "branch": "master", "commit": "3610dc7dc91f06aa98b11dca5cc30dfa98626b7e" },
|
||||
"telescope-fzf-native.nvim": { "branch": "main", "commit": "6fea601bd2b694c6f2ae08a6c6fab14930c60e2c" },
|
||||
"telescope-live-grep-args.nvim": { "branch": "master", "commit": "8ad632f793fd437865f99af5684f78300dac93fb" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||
"vim-commentary": { "branch": "master", "commit": "64a654ef4a20db1727938338310209b6a63f60c9" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "3b753cf8c6a4dcde6edee8827d464ba9b8c4a6f0" },
|
||||
"vim-rhubarb": { "branch": "master", "commit": "5496d7c94581c4c9ad7430357449bb57fc59f501" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"vimtex": { "branch": "master", "commit": "82d2305ff71dfb3bd91602534cc9bb9a195bcb38" }
|
||||
}
|
||||
69
nvim/lua/mappings.lua
Normal file
69
nvim/lua/mappings.lua
Normal file
@@ -0,0 +1,69 @@
|
||||
local u = require("utils")
|
||||
|
||||
vim.keymap.set("n", "<leader>pv", vim.cmd.Ex)
|
||||
vim.keymap.set("n", "<leader>h", ":noh<CR>")
|
||||
|
||||
--move line shortcut
|
||||
vim.keymap.set("n", "<M-j>", ":m +1<CR>==", {noremap = true})
|
||||
vim.keymap.set("n", "<M-k>", ":m -2<CR>==", {noremap = true})
|
||||
|
||||
vim.keymap.set("v", "<M-j>", ":m '>+1<CR>gv=gv", {noremap = true})
|
||||
vim.keymap.set("v", "<M-k>", ":m '<-2<CR>gv=gv", {noremap = true})
|
||||
|
||||
vim.keymap.set("n", "<C-d>", "<C-d>zz", {noremap = true})
|
||||
vim.keymap.set("n", "<C-u>", "<C-u>zz", {noremap = true})
|
||||
|
||||
vim.keymap.set("x", "<leader>p", "\"_dP")
|
||||
|
||||
--tab buffer
|
||||
vim.keymap.set("n", "<leader>fn", ":bnext<CR>", {noremap = true})
|
||||
vim.keymap.set("n", "<leader>fp", ":bprev<CR>", {noremap = true})
|
||||
|
||||
-- wrap toggle
|
||||
vim.keymap.set("n", "<leader>w", function() vim.o.wrap = not vim.o.wrap end, {noremap = true})
|
||||
|
||||
vim.o.clipboard = 'unnamedplus'
|
||||
|
||||
-- Diff mappings put/get then move to next change
|
||||
-- u.nmap("<leader>dg", "<CMD>diffget<CR>]c")
|
||||
-- u.nmap("<leader>dp", "<CMD>diffput<CR>]c")
|
||||
--
|
||||
-- u.nmap("<leader>dp", "<CMD>diffput<CR>]c")
|
||||
--
|
||||
-- -- Remap movement to move by column layout
|
||||
-- u.nvmap("j", "gj")
|
||||
-- u.nvmap("k", "gk")
|
||||
--
|
||||
-- u.nvmap(";", ":")
|
||||
|
||||
-- Window splitting remap"
|
||||
u.nmap("<C-h>", "<C-w>h")
|
||||
u.nmap("<C-k>", "<C-w>k")
|
||||
u.nmap("<C-l>", "<C-w>l")
|
||||
u.nmap("<C-j>", "<C-w>j")
|
||||
-- u.nmap("<C-w>z", ":cclose<CR>")
|
||||
--
|
||||
-- -- Exit terminal insert mode
|
||||
-- u.tmap("<Esc>", "<C-\\><C-n>")
|
||||
--
|
||||
-- -- Delete buffer without closing the window
|
||||
-- u.nmap("<leader>q", ":bp<bar>sp<bar>bn<bar>bd<CR>")
|
||||
--
|
||||
-- Fugitive
|
||||
-- u.nmap("<leader>gw", ":Gwrite<CR>")
|
||||
-- u.nmap("<leader>gr", ":Gread<CR>")
|
||||
-- u.nmap("<leader>gc", ":Git commit -v<CR>")
|
||||
-- u.nmap("<leader>gC", ":Git commit -v --amend<CR>")
|
||||
-- u.nmap("<leader>gs", ":Git<CR>")
|
||||
-- u.nmap("<leader>gd", ":Gdiff<CR>")
|
||||
u.nmap("<leader>gb", ":Git blame<CR>")
|
||||
|
||||
u.nmap("<leader>rl", ":RustFmt<CR>")
|
||||
|
||||
vim.keymap.set("n", "<leader>ri", function() vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled({0}), {0}) end)
|
||||
u.nmap("<leader>d", ":lua vim.lsp.buf.hover()<CR>")
|
||||
|
||||
|
||||
require("telescope-config")
|
||||
require("minifiles-config")
|
||||
require("vimtex-config")
|
||||
52
nvim/lua/minifiles-config.lua
Normal file
52
nvim/lua/minifiles-config.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
require('mini.files').setup({
|
||||
-- Customization of shown content
|
||||
content = {
|
||||
-- Predicate for which file system entries to show
|
||||
filter = nil,
|
||||
-- What prefix to show to the left of file system entry
|
||||
prefix = nil,
|
||||
-- In which order to show file system entries
|
||||
sort = nil,
|
||||
},
|
||||
|
||||
-- Module mappings created only inside explorer.
|
||||
-- Use `''` (empty string) to not create one.
|
||||
mappings = {
|
||||
close = 'q',
|
||||
go_in = 'l',
|
||||
go_in_plus = 'L',
|
||||
go_out = 'h',
|
||||
go_out_plus = 'H',
|
||||
reset = '<BS>',
|
||||
reveal_cwd = '@',
|
||||
show_help = 'g?',
|
||||
synchronize = '=',
|
||||
trim_left = '<',
|
||||
trim_right = '>',
|
||||
},
|
||||
|
||||
-- General options
|
||||
options = {
|
||||
-- Whether to delete permanently or move into module-specific trash
|
||||
permanent_delete = true,
|
||||
-- Whether to use for editing directories
|
||||
use_as_default_explorer = true,
|
||||
},
|
||||
|
||||
-- Customization of explorer windows
|
||||
windows = {
|
||||
-- Maximum number of windows to show side by side
|
||||
max_number = math.huge,
|
||||
-- Whether to show preview of file/directory under cursor
|
||||
preview = false,
|
||||
-- Width of focused window
|
||||
width_focus = 50,
|
||||
-- Width of non-focused window
|
||||
width_nofocus = 15,
|
||||
-- Width of preview window
|
||||
width_preview = 25,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "-", '<CMD>lua MiniFiles.open(vim.api.nvim_buf_get_name(0)); MiniFiles.reveal_cwd()<CR>', { desc = 'Open MiniFiles' })
|
||||
vim.keymap.set("n", "<ESC>", '<CMD>lua MiniFiles.close()<CR>', { desc = 'Close MiniFiles' })
|
||||
93
nvim/lua/packer-plugins.lua
Normal file
93
nvim/lua/packer-plugins.lua
Normal file
@@ -0,0 +1,93 @@
|
||||
return require('packer').startup(function()
|
||||
use 'wbthomason/packer.nvim'
|
||||
use 'sonph/onehalf'
|
||||
use 'navarasu/onedark.nvim'
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim', tag = '0.1.4',
|
||||
-- or , branch = '0.1.x',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
|
||||
require('onedark').setup {
|
||||
style = 'darker'
|
||||
}
|
||||
require('onedark').load()
|
||||
-- use({
|
||||
-- 'rose-pine/neovim',
|
||||
-- as = 'rose-pine',
|
||||
-- config = function()
|
||||
-- vim.cmd('colorscheme rose-pine')
|
||||
-- end
|
||||
-- })
|
||||
|
||||
use {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
'neovim/nvim-lspconfig'
|
||||
}
|
||||
use 'hrsh7th/nvim-cmp' -- Autocompletion plugin
|
||||
use 'hrsh7th/cmp-nvim-lsp' -- Autocompletion with LSPs
|
||||
use 'hrsh7th/cmp-buffer'
|
||||
use 'hrsh7th/cmp-path'
|
||||
|
||||
use {'neoclide/coc.nvim', branch = 'release'}
|
||||
|
||||
use('nvim-treesitter/nvim-treesitter', {run = ':TSUpdate'})
|
||||
|
||||
--use {
|
||||
-- 'VonHeikemen/lsp-zero.nvim',
|
||||
-- branch = 'v2.x',
|
||||
-- requires = {
|
||||
-- -- LSP Support
|
||||
-- {'neovim/nvim-lspconfig'},
|
||||
-- {'williamboman/mason.nvim', run = function()
|
||||
-- pcall(vim.cmd, 'MasonUpdate')
|
||||
-- end,},
|
||||
-- {'williamboman/mason-lspconfig.nvim'}, -- Optional
|
||||
|
||||
-- -- Autocompletion
|
||||
-- {'hrsh7th/nvim-cmp'}, -- Required
|
||||
-- {'hrsh7th/cmp-nvim-lsp'}, -- Required
|
||||
-- {'L3MON4D3/LuaSnip'}, -- Required
|
||||
-- }
|
||||
--}
|
||||
|
||||
-- Auto pairs
|
||||
use {
|
||||
"windwp/nvim-autopairs",
|
||||
config = function() require("nvim-autopairs").setup {} end
|
||||
}
|
||||
|
||||
--harpoon
|
||||
use("theprimeagen/harpoon")
|
||||
|
||||
---- neogen
|
||||
--local i = require("neogen.types.template").item
|
||||
--local annotation = {
|
||||
-- { nil, "/**", { no_results = true, type = { "func", "file", "class" } } },
|
||||
-- { nil, "** \\file", { no_results = true, type = { "file" } } },
|
||||
-- { nil, "** \\brief $1", { no_results = true, type = { "func", "file", "class" } } },
|
||||
-- { nil, "*/", { no_results = true, type = { "func", "file", "class" } } },
|
||||
-- { nil, "", { no_results = true, type = { "file" } } },
|
||||
|
||||
-- { nil, "/**", { type = { "func", "class", "type" } } },
|
||||
-- { i.ClassName, "** @class %s", { type = { "class" } } },
|
||||
-- { i.Type, "** @typedef %s", { type = { "type" } } },
|
||||
-- { nil, "** \\brief $1", { type = { "func", "class", "type" } } },
|
||||
-- { nil, "**", { type = { "func", "class", "type" } } },
|
||||
-- { i.Tparam, "** \\tparam %s $1" },
|
||||
-- { i.Parameter, "** \\param %s $1" },
|
||||
-- { i.Return, "** \\return $1" },
|
||||
-- { nil, "*/", { type = { "func", "class", "type" } } },
|
||||
--}
|
||||
--require("neogen").setup({
|
||||
-- languages = {
|
||||
-- c = {
|
||||
-- template = {
|
||||
-- annotation_convention = "my_annotation",
|
||||
-- my_annotation = annotation
|
||||
-- }
|
||||
-- }
|
||||
-- }
|
||||
--})
|
||||
end)
|
||||
6
nvim/lua/plugins/navic.lua
Normal file
6
nvim/lua/plugins/navic.lua
Normal file
@@ -0,0 +1,6 @@
|
||||
return {
|
||||
{
|
||||
"SmiteshP/nvim-navic",
|
||||
requires = "neovim/nvim-lspconfig"
|
||||
}
|
||||
}
|
||||
246
nvim/lua/plugins/plugins.lua
Normal file
246
nvim/lua/plugins/plugins.lua
Normal file
@@ -0,0 +1,246 @@
|
||||
return {
|
||||
-- Theme
|
||||
{
|
||||
-- Theme inspired by Atom
|
||||
'navarasu/onedark.nvim',
|
||||
priority = 1000,
|
||||
lazy = false,
|
||||
config = function()
|
||||
require('onedark').setup {
|
||||
-- Set a style preset. 'dark' is default.
|
||||
style = 'dark', -- dark, darker, cool, deep, warm, warmer, light
|
||||
hightlights = {
|
||||
Comment = { fg = '#5c6370', bg = 'NONE', fmt = 'italic' }, -- gray foreground
|
||||
["@comment"] = { fg = '#5c6370', bg = 'NONE', fmt = 'italic' }, -- gray foreground
|
||||
["@comment.go"] = { fg = '#5c6370', fmt = 'italic' },
|
||||
}
|
||||
}
|
||||
require('onedark').load()
|
||||
|
||||
-- Force override after theme loads
|
||||
vim.schedule(function()
|
||||
local comment_gray = '#5c6370'
|
||||
vim.api.nvim_set_hl(0, 'Comment', { fg = comment_gray, italic = true })
|
||||
vim.api.nvim_set_hl(0, '@comment', { fg = comment_gray, italic = true })
|
||||
vim.api.nvim_set_hl(0, '@comment.go', { fg = comment_gray, italic = true })
|
||||
vim.api.nvim_set_hl(0, '@comment.documentation', { fg = comment_gray, italic = true })
|
||||
vim.api.nvim_set_hl(0, 'SpecialComment', { fg = comment_gray, italic = true })
|
||||
vim.api.nvim_set_hl(0, '@lsp.type.comment', { fg = comment_gray, italic = true })
|
||||
end)
|
||||
|
||||
end,
|
||||
},
|
||||
|
||||
-- Icons (used by telescope, mini.files, etc.)
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
|
||||
-- Vim plugins
|
||||
"windwp/nvim-autopairs",
|
||||
|
||||
-- Git
|
||||
"tpope/vim-fugitive",
|
||||
"tpope/vim-rhubarb",
|
||||
{
|
||||
"linrongbin16/gitlinker.nvim",
|
||||
cmd = "GitLink",
|
||||
opts = {},
|
||||
keys = {
|
||||
{ "<leader>gy", "<cmd>GitLink<cr>", mode = { "n", "v" }, desc = "Yank git link" },
|
||||
{ "<leader>gY", "<cmd>GitLink!<cr>", mode = { "n", "v" }, desc = "Open git link" },
|
||||
},
|
||||
},
|
||||
|
||||
-- Vim
|
||||
{
|
||||
"lervag/vimtex",
|
||||
lazy = false, -- we don't want to lazy load VimTeX
|
||||
-- tag = "v2.15", -- uncomment to pin to a specific release
|
||||
init = function()
|
||||
-- VimTeX configuration goes here, e.g.
|
||||
vim.g.vimtex_view_method = "zathura"
|
||||
end
|
||||
},
|
||||
|
||||
|
||||
"tpope/vim-commentary",
|
||||
"tpope/vim-surround",
|
||||
-- "christoomey/vim-tmux-navigator",
|
||||
"AndrewRadev/linediff.vim",
|
||||
{ "echasnovski/mini.files", version = false },
|
||||
|
||||
|
||||
-- Nvim plugins
|
||||
{"nvim-treesitter/nvim-treesitter", branch = 'master', lazy = false, build = ":TSUpdate"},
|
||||
{ "nvim-treesitter/nvim-treesitter-context" },
|
||||
'danymat/neogen',
|
||||
"lukas-reineke/indent-blankline.nvim",
|
||||
{
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip"
|
||||
},
|
||||
config = function()
|
||||
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')
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end
|
||||
},
|
||||
completion = {
|
||||
autocomplete = { require('cmp.types').cmp.TriggerEvent.TextChanged },
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert ({
|
||||
["<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" }),
|
||||
["<c-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select=true }),
|
||||
}),
|
||||
sources = {
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
}
|
||||
})
|
||||
end
|
||||
},
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"hrsh7th/cmp-path",
|
||||
{
|
||||
"neovim/nvim-lspconfig",
|
||||
dependencies = {
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
config = function()
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||
|
||||
require('mason').setup()
|
||||
require('mason-lspconfig').setup({
|
||||
ensure_installed = { "pyright", "gopls" },
|
||||
handlers = {
|
||||
-- Default handler for all servers
|
||||
function(server_name)
|
||||
require('lspconfig')[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
})
|
||||
end,
|
||||
-- gopls with Go-specific settings
|
||||
["gopls"] = function()
|
||||
require('lspconfig').gopls.setup({
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
gopls = {
|
||||
analyses = {
|
||||
unusedparams = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
gofumpt = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
end
|
||||
},
|
||||
"nvim-lua/plenary.nvim",
|
||||
-- "jose-elias-alvarez/null-ls.nvim",
|
||||
-- "jose-elias-alvarez/typescript.nvim",
|
||||
-- "iamcco/markdown-preview.nvim", -- { 'do': { -> mkdp#util#install() }, 'for': ['markdown', 'vim-plug']}
|
||||
-- { "olimorris/persisted.nvim", dev = true },
|
||||
-- "folke/tokyonight.nvim", -- { 'branch': 'main' }
|
||||
"lewis6991/gitsigns.nvim",
|
||||
"williamboman/mason.nvim", -- { 'do': ':MasonUpdate' }
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
{
|
||||
'ThePrimeagen/harpoon',
|
||||
branch = 'harpoon2',
|
||||
opts = {
|
||||
menu = {
|
||||
width = vim.api.nvim_win_get_width(0) - 4,
|
||||
},
|
||||
},
|
||||
keys = {
|
||||
{
|
||||
'<leader>q',
|
||||
function()
|
||||
require('harpoon'):list():add()
|
||||
end,
|
||||
desc = 'Harpoon File',
|
||||
},
|
||||
{
|
||||
'<C-e>',
|
||||
function()
|
||||
local harpoon = require('harpoon')
|
||||
harpoon.ui:toggle_quick_menu(harpoon:list())
|
||||
end,
|
||||
desc = 'Harpoon Quick Menu',
|
||||
},
|
||||
{
|
||||
'<M-q>',
|
||||
function()
|
||||
require('harpoon'):list():select(1)
|
||||
end,
|
||||
desc = 'Harpoon to File 1',
|
||||
},
|
||||
{
|
||||
'<M-w>',
|
||||
function()
|
||||
require('harpoon'):list():select(2)
|
||||
end,
|
||||
desc = 'Harpoon to File 2',
|
||||
},
|
||||
{
|
||||
'<M-e>',
|
||||
function()
|
||||
require('harpoon'):list():select(3)
|
||||
end,
|
||||
desc = 'Harpoon to File 3',
|
||||
},
|
||||
{
|
||||
'<M-r>',
|
||||
function()
|
||||
require('harpoon'):list():select(4)
|
||||
end,
|
||||
desc = 'Harpoon to File 4',
|
||||
},
|
||||
{
|
||||
'<M-t>',
|
||||
function()
|
||||
require('harpoon'):list():select(5)
|
||||
end,
|
||||
desc = 'Harpoon to File 5',
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
122
nvim/lua/plugins/rust-tools.lua
Normal file
122
nvim/lua/plugins/rust-tools.lua
Normal file
@@ -0,0 +1,122 @@
|
||||
local opts = {
|
||||
tools = { -- rust-tools options
|
||||
|
||||
-- how to execute terminal commands
|
||||
-- options right now: termopen / quickfix / toggleterm / vimux
|
||||
-- executor = require("rust-tools.executors").termopen,
|
||||
|
||||
-- callback to execute once rust-analyzer is done initializing the workspace
|
||||
-- The callback receives one parameter indicating the `health` of the server: "ok" | "warning" | "error"
|
||||
on_initialized = nil,
|
||||
|
||||
-- automatically call RustReloadWorkspace when writing to a Cargo.toml file.
|
||||
reload_workspace_from_cargo_toml = true,
|
||||
|
||||
-- These apply to the default RustSetInlayHints command
|
||||
inlay_hints = {
|
||||
-- automatically set inlay hints (type hints)
|
||||
-- default: true
|
||||
auto = false,
|
||||
|
||||
-- Only show inlay hints for the current line
|
||||
only_current_line = false,
|
||||
|
||||
-- whether to show parameter hints with the inlay hints or not
|
||||
-- default: true
|
||||
show_parameter_hints = true,
|
||||
|
||||
-- prefix for parameter hints
|
||||
-- default: "<-"
|
||||
parameter_hints_prefix = "<- ",
|
||||
|
||||
-- prefix for all the other hints (type, chaining)
|
||||
-- default: "=>"
|
||||
other_hints_prefix = "=> ",
|
||||
|
||||
-- whether to align to the length of the longest line in the file
|
||||
max_len_align = false,
|
||||
|
||||
-- padding from the left if max_len_align is true
|
||||
max_len_align_padding = 1,
|
||||
|
||||
-- whether to align to the extreme right or not
|
||||
right_align = false,
|
||||
|
||||
-- padding from the right if right_align is true
|
||||
right_align_padding = 7,
|
||||
|
||||
-- The color of the hints
|
||||
highlight = "Comment",
|
||||
},
|
||||
|
||||
-- options same as lsp hover / vim.lsp.util.open_floating_preview()
|
||||
hover_actions = {
|
||||
|
||||
-- the border that is used for the hover window
|
||||
-- see vim.api.nvim_open_win()
|
||||
border = {
|
||||
{ "╭", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╮", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
{ "╯", "FloatBorder" },
|
||||
{ "─", "FloatBorder" },
|
||||
{ "╰", "FloatBorder" },
|
||||
{ "│", "FloatBorder" },
|
||||
},
|
||||
|
||||
-- Maximal width of the hover window. Nil means no max.
|
||||
max_width = nil,
|
||||
|
||||
-- Maximal height of the hover window. Nil means no max.
|
||||
max_height = nil,
|
||||
|
||||
-- whether the hover action window gets automatically focused
|
||||
-- default: false
|
||||
auto_focus = false,
|
||||
},
|
||||
},
|
||||
|
||||
-- all the opts to send to nvim-lspconfig
|
||||
-- these override the defaults set by rust-tools.nvim
|
||||
-- see https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#rust_analyzer
|
||||
server = {
|
||||
settings = {
|
||||
["rust-analyzer"] = {
|
||||
-- cargo = {
|
||||
-- features = "all",
|
||||
-- check = {
|
||||
-- overrideCommand = {
|
||||
-- "cargo check --quiet --message-format=json --all-targets",
|
||||
-- },
|
||||
-- },
|
||||
-- buildScripts = {
|
||||
-- overideCommand = {
|
||||
-- "cargo check --quiet --message-format=json --all-targets",
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
},
|
||||
},
|
||||
|
||||
on_attach = function(client, bufnr)
|
||||
if client.server_capabilities.inlayHintProvider then
|
||||
vim.lsp.inlay_hint.enable(true, { bufnr = bufnr })
|
||||
-- vim.api.nvim_set_keymap("n", "<leader>ri", "<CMD>lua vim.lsp.inlay_hint(0)<CR>", { noremap = true })
|
||||
end
|
||||
end,
|
||||
}, -- rust-analyzer options
|
||||
|
||||
-- debugging stuff
|
||||
-- dap = {
|
||||
-- adapter = {
|
||||
-- type = "executable",
|
||||
-- command = "lldb-vscode",
|
||||
-- name = "rt_lldb",
|
||||
-- },
|
||||
-- },
|
||||
}
|
||||
|
||||
return {
|
||||
{ "simrat39/rust-tools.nvim" },
|
||||
}
|
||||
34
nvim/lua/plugins/telescope.lua
Normal file
34
nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,34 @@
|
||||
return {
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
branch = "0.1.x",
|
||||
dependencies = {
|
||||
"nvim-lua/plenary.nvim",
|
||||
{
|
||||
|
||||
"nvim-telescope/telescope-live-grep-args.nvim" ,
|
||||
-- This will not install any breaking changes.
|
||||
-- For major updates, this must be adjusted manually.
|
||||
version = "^1.0.0",
|
||||
},
|
||||
},
|
||||
},
|
||||
{ "nvim-telescope/telescope-fzf-native.nvim", build = "make" },
|
||||
{
|
||||
"nvim-telescope/telescope-file-browser.nvim",
|
||||
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
config = function()
|
||||
local telescope = require("telescope")
|
||||
|
||||
-- first setup telescope
|
||||
telescope.setup({
|
||||
-- your config
|
||||
})
|
||||
|
||||
-- then load the extension
|
||||
telescope.load_extension("live_grep_args")
|
||||
end
|
||||
-- "debugloop/telescope-undo.nvim",
|
||||
-- "nvim-telescope/telescope-ui-select.nvim",
|
||||
}
|
||||
48
nvim/lua/settings.lua
Normal file
48
nvim/lua/settings.lua
Normal file
@@ -0,0 +1,48 @@
|
||||
local opt = vim.o-- global options
|
||||
|
||||
vim.lsp.log.set_level("off")
|
||||
|
||||
-- Theme
|
||||
-- Options
|
||||
opt.relativenumber = true
|
||||
opt.colorcolumn = "80"
|
||||
opt.number = true
|
||||
opt.tabstop = 2
|
||||
opt.softtabstop = 2
|
||||
opt.shiftwidth = 2
|
||||
opt.expandtab = true
|
||||
opt.smartindent = true
|
||||
|
||||
-- Make line numbers default
|
||||
vim.wo.number = true
|
||||
|
||||
-- Enable mouse mode
|
||||
opt.mouse = 'a'
|
||||
|
||||
-- Sync clipboard between OS and Neovim.
|
||||
opt.clipboard = 'unnamedplus'
|
||||
|
||||
-- Enable break indent
|
||||
opt.breakindent = true
|
||||
|
||||
-- Save undo history
|
||||
opt.undofile = true
|
||||
|
||||
-- Keep signcolumn on by default
|
||||
vim.wo.signcolumn = 'yes'
|
||||
|
||||
-- Decrease update time
|
||||
opt.updatetime = 250
|
||||
opt.timeoutlen = 300
|
||||
|
||||
-- Set completeopt to have a better completion experience
|
||||
opt.completeopt = 'menuone,noselect'
|
||||
|
||||
--ignore case if pattern doesn't contain upper case
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
|
||||
--number of line to show around the cursor
|
||||
opt.scrolloff = 8
|
||||
|
||||
-- vim.g.rustfmt_autosave = 1
|
||||
90
nvim/lua/setup.lua
Normal file
90
nvim/lua/setup.lua
Normal file
@@ -0,0 +1,90 @@
|
||||
-- nvim-autopairs
|
||||
require("nvim-autopairs").setup()
|
||||
|
||||
-- gitsigns
|
||||
require("gitsigns").setup()
|
||||
|
||||
require'treesitter-context'.setup{
|
||||
enable = true, -- Enable this plugin (Can be enabled/disabled later via commands)
|
||||
multiwindow = false, -- Enable multiwindow support.
|
||||
max_lines = 0, -- How many lines the window should span. Values <= 0 mean no limit.
|
||||
min_window_height = 0, -- Minimum editor window height to enable context. Values <= 0 mean no limit.
|
||||
line_numbers = true,
|
||||
multiline_threshold = 20, -- Maximum number of lines to show for a single context
|
||||
trim_scope = 'outer', -- Which context lines to discard if `max_lines` is exceeded. Choices: 'inner', 'outer'
|
||||
mode = 'cursor', -- Line used to calculate context. Choices: 'cursor', 'topline'
|
||||
separator = nil,
|
||||
zindex = 20, -- The Z-index of the context window
|
||||
on_attach = nil, -- (fun(buf: integer): boolean) return false to disable attaching
|
||||
}
|
||||
|
||||
-- Tree sitter
|
||||
require("nvim-treesitter.configs").setup({
|
||||
ensure_installed = {
|
||||
"c", "cpp", "go", "lua", "markdown", "python", "rust", "tsx", "typescript", "vim"
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
context_commentstring = { enable = true },
|
||||
playground = { enable = true },
|
||||
query_linter = { enable = true },
|
||||
locals = { enable = true },
|
||||
})
|
||||
|
||||
-- Telescope
|
||||
local actions = require("telescope.actions")
|
||||
local previewers = require("telescope.previewers")
|
||||
local builtin = require("telescope.builtin")
|
||||
require("telescope").setup({
|
||||
defaults = {
|
||||
vimgrep_arguments = {
|
||||
"rg",
|
||||
"--color=never",
|
||||
"--no-heading",
|
||||
"--with-filename",
|
||||
"--line-number",
|
||||
"--column",
|
||||
"--smart-case",
|
||||
},
|
||||
},
|
||||
})
|
||||
|
||||
require("telescope").load_extension("fzf")
|
||||
|
||||
-- Disable underline
|
||||
vim.diagnostic.config({
|
||||
virtual_text = true,
|
||||
underline = false,
|
||||
})
|
||||
|
||||
require('neogen').setup {}
|
||||
vim.keymap.set('n', '<leader>ne', ':lua require("neogen").generate()<CR>', { desc = '[G]enerate [D]ocumentation' })
|
||||
|
||||
-- Key bindings
|
||||
|
||||
-- common lsp
|
||||
vim.api.nvim_set_keymap("n", "gD", "<cmd>lua vim.lsp.buf.declaration()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "gd", "<cmd>lua vim.lsp.buf.definition()<CR>", { silent = true })
|
||||
vim.keymap.set("n", "gr", "<cmd>Telescope lsp_references<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "K", "<cmd>lua vim.lsp.buf.hover()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "gi", "<cmd>lua vim.lsp.buf.implementation()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>k", "<cmd>lua vim.lsp.buf.signature_help()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>t", "<cmd>lua vim.lsp.buf.format()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap(
|
||||
"n",
|
||||
"<space>wl",
|
||||
"<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>",
|
||||
{ silent = true }
|
||||
)
|
||||
vim.api.nvim_set_keymap("n", "<space>D", "<cmd>lua vim.lsp.buf.type_definition()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>rn", "<cmd>lua vim.lsp.buf.rename()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>ca", "<cmd>lua vim.lsp.buf.code_action()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "<space>e", "<cmd>lua vim.diagnostic.open_float()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "[d", "<cmd>lua vim.diagnostic.goto_prev()<CR>", { silent = true })
|
||||
vim.api.nvim_set_keymap("n", "]d", "<cmd>lua vim.diagnostic.goto_next()<CR>", { silent = true })
|
||||
24
nvim/lua/telescope-config.lua
Normal file
24
nvim/lua/telescope-config.lua
Normal file
@@ -0,0 +1,24 @@
|
||||
local telescope = require('telescope')
|
||||
local lga_actions = require("telescope-live-grep-args.actions")
|
||||
local builtin = require('telescope.builtin')
|
||||
local live_grep_args_shortcuts = require("telescope-live-grep-args.shortcuts")
|
||||
|
||||
telescope.setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-u>'] = false,
|
||||
['<C-d>'] = false,
|
||||
["<C-k>"] = lga_actions.quote_prompt(),
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
telescope.load_extension("live_grep_args")
|
||||
|
||||
vim.keymap.set('n', '<leader>pf', builtin.find_files, {noremap = true})
|
||||
vim.keymap.set("n", "<leader>pg", telescope.extensions.live_grep_args.live_grep_args)
|
||||
-- vim.keymap.set('n', '<leader>lg', builtin.live_grep, {noremap = true})
|
||||
vim.keymap.set('n', '<leader>gs', builtin.grep_string, {noremap = true})
|
||||
|
||||
vim.keymap.set("n", "<leader>pw", live_grep_args_shortcuts.grep_word_under_cursor)
|
||||
27
nvim/lua/utils.lua
Normal file
27
nvim/lua/utils.lua
Normal file
@@ -0,0 +1,27 @@
|
||||
local M = {}
|
||||
|
||||
M.map = function(mode, shortcut, command)
|
||||
vim.keymap.set(mode, shortcut, command, { noremap = true, silent = true })
|
||||
end
|
||||
|
||||
M.nmap = function(shortcut, command)
|
||||
M.map("n", shortcut, command)
|
||||
end
|
||||
|
||||
M.imap = function(shortcut, command)
|
||||
M.map("i", shortcut, command)
|
||||
end
|
||||
|
||||
M.vmap = function(shortcut, command)
|
||||
M.map("v", shortcut, command)
|
||||
end
|
||||
|
||||
M.nvmap = function(shortcut, command)
|
||||
M.map({ "n", "v" }, shortcut, command)
|
||||
end
|
||||
|
||||
M.tmap = function(shortcut, command)
|
||||
M.map("t", shortcut, command)
|
||||
end
|
||||
|
||||
return M
|
||||
46
nvim/lua/vimtex-config.lua
Normal file
46
nvim/lua/vimtex-config.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
-- " This is necessary for VimTeX to load properly. The "indent" is optional.
|
||||
-- " Note: Most plugin managers will do this automatically!
|
||||
-- filetype plugin indent on
|
||||
|
||||
-- " This enables Vim's and neovim's syntax-related features. Without this, some
|
||||
-- " VimTeX features will not work (see ":help vimtex-requirements" for more
|
||||
-- " info).
|
||||
-- " Note: Most plugin managers will do this automatically!
|
||||
-- syntax enable
|
||||
|
||||
-- " Viewer options: One may configure the viewer either by specifying a built-in
|
||||
-- " viewer method:
|
||||
-- let g:vimtex_view_method = 'zathura'
|
||||
|
||||
-- " Or with a generic interface:
|
||||
-- let g:vimtex_view_general_viewer = 'okular'
|
||||
-- let g:vimtex_view_general_options = '--unique file:@pdf\#src:@line@tex'
|
||||
|
||||
-- " VimTeX uses latexmk as the default compiler backend. If you use it, which is
|
||||
-- " strongly recommended, you probably don't need to configure anything. If you
|
||||
-- " want another compiler backend, you can change it as follows. The list of
|
||||
-- " supported backends and further explanation is provided in the documentation,
|
||||
-- " see ":help vimtex-compiler".
|
||||
-- let g:vimtex_compiler_method = 'latexrun'
|
||||
|
||||
-- " Most VimTeX mappings rely on localleader and this can be changed with the
|
||||
-- " following line. The default is usually fine and is the symbol "\".
|
||||
vim.cmd("filetype plugin indent on")
|
||||
vim.cmd("syntax enable")
|
||||
vim.g.vimtex_view_method = 'zathura'
|
||||
vim.g.vimtex_compiler_method = 'latexrun'
|
||||
vim.g.vimtex_toc_config = {
|
||||
name = 'TOC',
|
||||
layers = { 'content', 'todo', 'include' },
|
||||
resize = 1,
|
||||
split_width = 50,
|
||||
todo_sorted = 0,
|
||||
show_help = 1,
|
||||
show_numbers = 1,
|
||||
mode = 2,
|
||||
}
|
||||
-- Key mappings
|
||||
vim.api.nvim_set_keymap('n', '<leader>m', ':VimtexTocOpen<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<leader>v', ':VimtexView<CR>', { noremap = true, silent = true })
|
||||
vim.api.nvim_set_keymap('n', '<leader>c', ':VimtexCompile<CR>', { noremap = true, silent = true })
|
||||
|
||||
11
nvim/plugin/harpoon.lua
Normal file
11
nvim/plugin/harpoon.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
local harpoon = require("harpoon")
|
||||
harpoon:setup()
|
||||
--
|
||||
-- vim.keymap.set("n", "<leader>q", function() harpoon:list().append() end)
|
||||
-- vim.keymap.set("n", "<C-e>", function() harpoon.ui:toggle_quick_menu(harpoon:list()) end)
|
||||
--
|
||||
-- vim.keymap.set("n", "<M-q>", function() harpoon:list():select(1) end)
|
||||
-- vim.keymap.set("n", "<M-w>", function() harpoon:list():select(2) end)
|
||||
-- vim.keymap.set("n", "<M-e>", function() harpoon:list():select(3) end)
|
||||
-- vim.keymap.set("n", "<M-r>", function() harpoon:list():select(4) end)
|
||||
-- vim.keymap.set("n", "<M-t>", function() harpoon:list():select(5) end)
|
||||
52
nvim/plugin/minifiles.lua
Normal file
52
nvim/plugin/minifiles.lua
Normal file
@@ -0,0 +1,52 @@
|
||||
require('mini.files').setup({
|
||||
-- Customization of shown content
|
||||
content = {
|
||||
-- Predicate for which file system entries to show
|
||||
filter = nil,
|
||||
-- What prefix to show to the left of file system entry
|
||||
prefix = nil,
|
||||
-- In which order to show file system entries
|
||||
sort = nil,
|
||||
},
|
||||
|
||||
-- Module mappings created only inside explorer.
|
||||
-- Use `''` (empty string) to not create one.
|
||||
mappings = {
|
||||
close = 'q',
|
||||
go_in = 'l',
|
||||
go_in_plus = 'L',
|
||||
go_out = 'h',
|
||||
go_out_plus = 'H',
|
||||
reset = '<BS>',
|
||||
reveal_cwd = '@',
|
||||
show_help = 'g?',
|
||||
synchronize = '=',
|
||||
trim_left = '<',
|
||||
trim_right = '>',
|
||||
},
|
||||
|
||||
-- General options
|
||||
options = {
|
||||
-- Whether to delete permanently or move into module-specific trash
|
||||
permanent_delete = true,
|
||||
-- Whether to use for editing directories
|
||||
use_as_default_explorer = true,
|
||||
},
|
||||
|
||||
-- Customization of explorer windows
|
||||
windows = {
|
||||
-- Maximum number of windows to show side by side
|
||||
max_number = math.huge,
|
||||
-- Whether to show preview of file/directory under cursor
|
||||
preview = false,
|
||||
-- Width of focused window
|
||||
width_focus = 50,
|
||||
-- Width of non-focused window
|
||||
width_nofocus = 15,
|
||||
-- Width of preview window
|
||||
width_preview = 25,
|
||||
},
|
||||
})
|
||||
|
||||
vim.keymap.set("n", "-", '<CMD>lua MiniFiles.open(vim.api.nvim_buf_get_name(0)); MiniFiles.reveal_cwd()<CR>', { desc = 'Open MiniFiles' })
|
||||
vim.keymap.set("n", "<ESC>", '<CMD>lua MiniFiles.close()<CR>', { desc = 'Close MiniFiles' })
|
||||
50
nvim/plugin/rustaceanvim.lua
Normal file
50
nvim/plugin/rustaceanvim.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
-- vim.g.auto_ra_attach = true
|
||||
--
|
||||
-- vim.g.rustaceanvim = {
|
||||
-- -- Plugin configuration
|
||||
-- tools = {},
|
||||
-- -- LSP configuration
|
||||
-- ---@type RustaceanLspClientOpts
|
||||
-- server = {
|
||||
-- load_vscode_settings = true,
|
||||
-- auto_attach = function(bufnr)
|
||||
-- return vim.g.auto_ra_attach
|
||||
-- end,
|
||||
-- on_attach = function(client, _)
|
||||
-- client.server_capabilities.workspace.didChangeWatchedFiles = {
|
||||
-- dynamicRegistration = false,
|
||||
-- relativePatternSupport = false,
|
||||
-- }
|
||||
--
|
||||
-- vim.api.nvim_create_autocmd({ 'BufEnter' }, {
|
||||
-- desc = 'Resize splits when resizing the window',
|
||||
-- pattern = { '*.rs' },
|
||||
-- callback = function()
|
||||
-- vim.cmd('RustAnalyzer reloadSettings')
|
||||
-- end,
|
||||
-- })
|
||||
-- end,
|
||||
-- default_settings = {
|
||||
-- ['rust-analyzer'] = {
|
||||
-- cachePriming = false,
|
||||
-- rustfmt = {
|
||||
-- extraArgs = {
|
||||
-- '--config',
|
||||
-- 'comment_width=120,condense_wildcard_suffixes=false,format_code_in_doc_comments=true,format_macro_bodies=true,hex_literal_case=Upper,imports_granularity=One,normalize_doc_attributes=true,wrap_comments=true',
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- },
|
||||
-- -- DAP configuration
|
||||
-- dap = {},
|
||||
-- }
|
||||
--
|
||||
-- return {
|
||||
-- {
|
||||
-- 'mrcjkb/rustaceanvim',
|
||||
-- version = '^4', -- Recommended
|
||||
-- ft = { 'rust' },
|
||||
-- dev = true,
|
||||
-- },
|
||||
-- }
|
||||
18
nvim/plugin/telescope.lua
Normal file
18
nvim/plugin/telescope.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
-- [[ Configure Telescope ]]
|
||||
-- See `:help telescope` and `:help telescope.setup()`
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
['<C-u>'] = false,
|
||||
['<C-d>'] = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
local builtin = require('telescope.builtin')
|
||||
|
||||
vim.keymap.set('n', '<leader>pf', builtin.find_files, {noremap = true})
|
||||
vim.keymap.set('n', '<leader>pg', builtin.live_grep, {noremap = true})
|
||||
vim.keymap.set('n', '<C-p>', builtin.git_files, {noremap = true})
|
||||
Reference in New Issue
Block a user