feat: initial commit
This commit is contained in:
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",
|
||||
}
|
||||
Reference in New Issue
Block a user