Add initial commit to repo

- Adds everything
- Does need to be documented so that this is not forgotten
This commit is contained in:
Christopher Williams 2023-12-26 12:37:50 -05:00
commit e7771c4240
16 changed files with 765 additions and 0 deletions

129
init.lua Normal file
View File

@ -0,0 +1,129 @@
require('mappings')
require('lazy-config')
require('gopls')
require('code-completion')
require('cokeline-config')
require('commands')
local vim = vim
-- disable netrw at the very start of your init.lua (strongly advised)
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1
-- nvim-tree
require('nvim-tree').setup {
on_attach = nvim_tree_attach,
}
-- Bufferline
vim.opt.termguicolors = true
-- Theme
require('onedark').load()
-- navic
local navic = require("nvim-navic")
navic.setup({
icons = {
File = "󰈙 ",
Module = "",
Namespace = "󰌗 ",
Package = "",
Class = "󰌗 ",
Method = "󰆧 ",
Property = "",
Field = "",
Constructor = "",
Enum = "󰕘",
Interface = "󰕘",
Function = "󰊕 ",
Variable = "󰆧 ",
Constant = "󰏿 ",
String = "󰀬 ",
Number = "󰎠 ",
Boolean = "",
Array = "󰅪 ",
Object = "󰅩 ",
Key = "󰌋 ",
Null = "󰟢 ",
EnumMember = "",
Struct = "󰌗 ",
Event = "",
Operator = "󰆕 ",
TypeParameter = "󰊄 ",
},
})
require("lualine").setup({
sections = {
lualine_c = {
{
require('auto-session.lib').current_session_name
},
{
"navic",
color_correction = nil,
navic_opts = nil
},
}
},
})
-- neodev
require("neodev").setup({})
-- Mason
require('mason-config')
lspconfig = require "lspconfig"
lspconfig.pyright.setup {}
lspconfig.csharp_ls.setup {}
lspconfig.lua_ls.setup {
settings = {
Lua = {
completion = {
callSnippet = "Replace"
}
}
}
}
lspconfig.rust_analyzer.setup {}
lspconfig.clangd.setup {
on_attach = function(client, bufnr)
navic.attach(client, bufnr)
end
}
-- Goto
goto_preview = require('goto-preview')
goto_preview.setup {}
-- conform
require("conform").setup({
formatters_by_ft = {
lua = { "stylua" },
-- Conform will run multiple formatters sequentially
python = { "isort", "black" },
-- Use a sub-list to run only the first available formatter
javascript = { { "prettierd", "prettier" } },
},
})
-- General
vim.opt.number = true
vim.opt.relativenumber = true
vim.opt.tabstop = 4
vim.opt.shiftwidth = 4
vim.opt.expandtab = true
-- vim.opt.foldenable = true
-- vim.opt.foldopen = "all"
-- vim.opt.foldmethod = 'expr'
-- vim.opt.foldexpr = 'nvim_treesitter#foldexpr()'
vim.opt.foldlevel = 99
vim.opt.hlsearch = true
vim.opt.cursorline = true
vim.opt.splitbelow = true

62
lazy-lock.json Normal file
View File

@ -0,0 +1,62 @@
{
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
"LuaSnip": { "branch": "master", "commit": "0b4950a237ce441a6a3a947d501622453f6860ea" },
"aerial.nvim": { "branch": "master", "commit": "8e4090bf9412e24b05823c771cb3956c2ba72981" },
"auto-pairs": { "branch": "master", "commit": "39f06b873a8449af8ff6a3eee716d3da14d63a76" },
"auto-session": { "branch": "main", "commit": "3eb26b949e1b90798e84926848551046e2eb0721" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "3d8912ebeb56e5ae08ef0906e3a54de1c66b92f1" },
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-vsnip": { "branch": "main", "commit": "989a8a73c44e926199bfd05fa7a516d51f2d2752" },
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
"conform.nvim": { "branch": "master", "commit": "ca3dfba94600aa62bfc88ae37cbd4f17eaea2553" },
"copilot.vim": { "branch": "release", "commit": "309b3c803d1862d5e84c7c9c5749ae04010123b8" },
"dashboard-nvim": { "branch": "master", "commit": "63df28409d940f9cac0a925df09d3dc369db9841" },
"diffview.nvim": { "branch": "main", "commit": "d38c1b5266850f77f75e006bcc26213684e1e141" },
"fzf": { "branch": "master", "commit": "108493524110c8f996231eb5e51b93da7a9b57ca" },
"fzf-lua": { "branch": "main", "commit": "e1046726cf0cedf15ae0ff40537a421b79968c3e" },
"fzf.vim": { "branch": "master", "commit": "1e054c1d075d87903647db9320116d360eb8b024" },
"git-messenger.vim": { "branch": "master", "commit": "8a61bdfa351d4df9a9118ee1d3f45edbed617072" },
"gitsigns.nvim": { "branch": "main", "commit": "af0f583cd35286dd6f0e3ed52622728703237e50" },
"glow.nvim": { "branch": "main", "commit": "5b38fb7b6e806cac62707a4aba8c10c5f14d5bb5" },
"goto-preview": { "branch": "main", "commit": "b428db4d2a5b7c06e149a020e31b2121fbf57a67" },
"guess-indent.nvim": { "branch": "main", "commit": "b8ae749fce17aa4c267eec80a6984130b94f80b2" },
"harpoon": { "branch": "master", "commit": "c1aebbad9e3d13f20bedb8f2ce8b3a94e39e424a" },
"indent-blankline.nvim": { "branch": "master", "commit": "29be0919b91fb59eca9e90690d76014233392bef" },
"lazy.nvim": { "branch": "main", "commit": "96584866b9c5e998cbae300594d0ccfd0c464627" },
"lualine.nvim": { "branch": "master", "commit": "2248ef254d0a1488a72041cfb45ca9caada6d994" },
"mason-lspconfig.nvim": { "branch": "main", "commit": "6eb8cae80f2e4322ec82cd9f8fa423f6d1eb02c3" },
"mason.nvim": { "branch": "main", "commit": "41e75af1f578e55ba050c863587cffde3556ffa6" },
"neodev.nvim": { "branch": "main", "commit": "1fc168ee385441994d7e9397e854cb20f5c7e324" },
"neogit": { "branch": "master", "commit": "d3c5687a78cffc25026ff31d2fcbd61a2a3e067f" },
"nvim-cmp": { "branch": "main", "commit": "0b751f6beef40fd47375eaf53d3057e0bfa317e4" },
"nvim-cokeline": { "branch": "main", "commit": "2e71292a37535fdbcf0f9500aeb141021d90af8b" },
"nvim-lspconfig": { "branch": "master", "commit": "36e4ffec0a9e373ac9dbf7949d3567c8f04ca3df" },
"nvim-navic": { "branch": "master", "commit": "0ffa7ffe6588f3417e680439872f5049e38a24db" },
"nvim-tree.lua": { "branch": "master", "commit": "a2aaf8b430c11af36b869cf1c0ad2f7c8ceeaf2c" },
"nvim-treesitter": { "branch": "master", "commit": "8996612bfbebe1657e1bb55a95201c96cab945c6" },
"nvim-ufo": { "branch": "main", "commit": "c6d88523f574024b788f1c3400c5d5b9bb1a0407" },
"nvim-web-devicons": { "branch": "master", "commit": "47103b80c38c59f7a1b5408c232b92bf5d018651" },
"oil.nvim": { "branch": "master", "commit": "af04969c437e0c46a2b3c86d7892458e878ecc40" },
"onedark.nvim": { "branch": "master", "commit": "b9acd92ded2ba155867ca5af9d618e933d96e3b0" },
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
"promise-async": { "branch": "main", "commit": "94f6f03c6c1e2aab551aacdf0c1e597a7269abb6" },
"rainbow": { "branch": "master", "commit": "61f719aebe0dc5c3048330c50db72cfee1afdd34" },
"refactoring.nvim": { "branch": "master", "commit": "156532476deb10b1b2a32cb38e1078b3f9951c42" },
"remember.nvim": { "branch": "master", "commit": "b7613e14692478a0428dc69ca380b6fbb2448e60" },
"resession.nvim": { "branch": "master", "commit": "b0107dc2cec1f24cf5a90a794a652eb66178ad8e" },
"rest.nvim": { "branch": "main", "commit": "b8d6c0a8762fd374e0204768a94241135ca3e311" },
"rust-tools.nvim": { "branch": "master", "commit": "0cc8adab23117783a0292a0c8a2fbed1005dc645" },
"telescope.nvim": { "branch": "master", "commit": "20bf20500c95208c3ac0ef07245065bf94dcab15" },
"todo-comments.nvim": { "branch": "main", "commit": "4a6737a8d70fe1ac55c64dfa47fcb189ca431872" },
"toggleterm.nvim": { "branch": "main", "commit": "faee9d60428afc7857e0927fdc18daa6c409fa64" },
"trouble.nvim": { "branch": "main", "commit": "f1168feada93c0154ede4d1fe9183bf69bac54ea" },
"vim-sleuth": { "branch": "master", "commit": "1cc4557420f215d02c4d2645a748a816c220e99b" },
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
"vim-visual-multi": { "branch": "master", "commit": "aec289a9fdabaa0ee6087d044d75b32e12084344" },
"vim-vsnip": { "branch": "master", "commit": "be277461265f1e5c7db470aa479f30956597ea9e" },
"which-key.nvim": { "branch": "main", "commit": "4433e5ec9a507e5097571ed55c02ea9658fb268a" }
}

3
lua/.luarc.json Normal file
View File

@ -0,0 +1,3 @@
{
"workspace.checkThirdParty": false
}

27
lua/auto-commands.lua Normal file
View File

@ -0,0 +1,27 @@
local vim = vim
local M = {}
-- function to create a list of commands and convert them to autocommands
-------- This function is taken from https://github.com/norcalli/nvim_utils
function M.nvim_create_augroups(definitions)
for group_name, definition in pairs(definitions) do
vim.api.nvim_command('augroup '..group_name)
vim.api.nvim_command('autocmd!')
for _, def in ipairs(definition) do
local command = table.concat(vim.tbl_flatten{'autocmd', def}, ' ')
vim.api.nvim_command(command)
end
vim.api.nvim_command('augroup END')
end
end
local autoCommands = {
-- other autocommands
open_folds = {
{"BufReadPost,FileReadPost", "*", "normal zR"}
}
}
M.nvim_create_augroups(autoCommands)

46
lua/code-completion.lua Normal file
View File

@ -0,0 +1,46 @@
-- completeopt is used to manage code suggestions
-- menuone: show popup even when there is only one suggestion
-- noinsert: Only insert text when selection is confirmed
-- noselect: force us to select one from the suggestions
vim.opt.completeopt = {'menuone', 'noselect', 'noinsert', 'preview'}
-- shortmess is used to avoid excessive messages
vim.opt.shortmess = vim.opt.shortmess + { c = true}
local cmp = require'cmp'
cmp.setup({
snippet = {
expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
end,
},
mapping = {
-- Shift+TAB to go to the Previous Suggested item
['<Up>'] = cmp.mapping.select_prev_item(),
-- Tab to go to the next suggestion
['<Down>'] = cmp.mapping.select_next_item(),
-- CTRL+SHIFT+f to scroll backwards in description
['<C-S-f>'] = cmp.mapping.scroll_docs(-4),
-- CTRL+F to scroll forwards in the description
['<C-f>'] = cmp.mapping.scroll_docs(4),
-- CTRL+SPACE to bring up completion at current Cursor location
['<C-Space>'] = cmp.mapping.complete(),
-- CTRL+e to exit suggestion and close it
['<C-e>'] = cmp.mapping.close(),
-- CR (enter or return) to CONFIRM the currently selection suggestion
-- We set the ConfirmBehavior to insert the Selected suggestion
['<CR>'] = cmp.mapping.confirm({
behavior = cmp.ConfirmBehavior.Insert,
select = true,
})
},
-- sources are the installed sources that can be used for code suggestions
sources = {
{ name = 'path' },
{ name = 'nvim_lsp', keyword_length = 3 },
{ name = 'nvim_lsp_signature_help'},
{ name = 'nvim_lua', keyword_length = 2},
{ name = 'buffer', keyword_length = 2 },
{ name = 'vsnip', keyword_length = 2 },
}
})

69
lua/cokeline-config.lua Normal file
View File

@ -0,0 +1,69 @@
local is_picking_focus = require('cokeline.mappings').is_picking_focus
local is_picking_close = require('cokeline.mappings').is_picking_close
local get_hex = require('cokeline.hlgroups').get_hl_attr
local red = vim.g.terminal_color_1
local yellow = vim.g.terminal_color_3
require('cokeline').setup({
default_hl = {
fg = function(buffer)
return
buffer.is_focused
and get_hex('ColorColumn', 'bg')
or get_hex('Normal', 'fg')
end,
bg = function(buffer)
return
buffer.is_focused
and get_hex('Normal', 'fg')
or get_hex('ColorColumn', 'bg')
end,
},
components = {
{
text = function(buffer) return (buffer.index ~= 1) and '' or '' end,
},
{
text = ' ',
},
{
text = function(buffer)
return
(is_picking_focus() or is_picking_close())
and buffer.pick_letter .. ' '
or buffer.devicon.icon
end,
fg = function(buffer)
return
(is_picking_focus() and yellow)
or (is_picking_close() and red)
or buffer.devicon.color
end,
italic = function()
return
(is_picking_focus() or is_picking_close())
end,
bold = function()
return
(is_picking_focus() or is_picking_close())
end
},
{
text = function(buffer) return buffer.filename .. ' ' end,
underline = function(buffer)
return buffer.is_hovered and not buffer.is_focused
end
},
{
text = '󰖭',
on_click = function(_, _, _, _, buffer)
buffer:delete()
end
},
{
text = ' ',
}
},
})

11
lua/commands.lua Normal file
View File

@ -0,0 +1,11 @@
vim.api.nvim_create_user_command("Format", function(args)
local range = nil
if args.count ~= -1 then
local end_line = vim.api.nvim_buf_get_lines(0, args.line2 - 1, args.line2, true)[1]
range = {
start = { args.line1, 0 },
["end"] = { args.line2, end_line:len() },
}
end
require("conform").format({ async = true, lsp_fallback = true, range = range })
end, { range = true })

6
lua/csharp.lua Normal file
View File

@ -0,0 +1,6 @@
lspconfig = require "lspconfig"
util = require "lspconfig/util"
lspconfig.csharp-language-server.setup {
filetypes = {"cs"}
}

19
lua/gopls.lua Normal file
View File

@ -0,0 +1,19 @@
-- Require LSP config which we can use to attach gopls
lspconfig = require "lspconfig"
util = require "lspconfig/util"
-- Since we installed lspconfig and imported it, we can reach
-- gopls by lspconfig.gopls
-- we can then set it up using the setup and insert the needed configurations
lspconfig.gopls.setup {
cmd = {"gopls", "serve"},
filetypes = {"go", "gomod"},
root_dir = util.root_pattern("go.work", "go.mod", ".git"),
settings = {
gopls = {
analyses = {
unusedparams = true,
},
staticcheck = true,
},
},
}

14
lua/lazy-config.lua Normal file
View File

@ -0,0 +1,14 @@
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",
lazypath,
})
end
vim.opt.rtp:prepend(lazypath)
require("lazy").setup('plugins')

87
lua/mappings.lua Normal file
View File

@ -0,0 +1,87 @@
-- General
vim.g.mapleader = " "
-- Window Functions using Leader W J/K/H/L
vim.api.nvim_set_keymap("n", "<leader>wj", "<C-w>j", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>wk", "<C-w>k", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>wh", "<C-w>h", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>wl", "<C-w>l", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>`", "<C-w>w", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>wc", "<C-w>q", { noremap = true, silent = true })
-- Github Copilot
-- Set accept to CTRL + J
vim.g.copilot_no_tab_map = true
vim.api.nvim_set_keymap("i", "<TAB>", 'copilot#Accept("<CR>")', { silent = true, expr = true })
-- nvim-tree
local function nvim_tree_attach(bufnr)
local api = require "nvim-tree.api"
local function opts(desc)
return { desc = "nvim-tree: " .. desc, buffer = bufnr, noremap = true, silent = true, nowait = true }
end
-- default mappings
api.config.mappings.default_on_attach(bufnr)
-- custom mappings
vim.keymap.set('n', '<C-t>', api.tree.change_root_to_parent, opts('Up'))
vim.keymap.set('n', '?', api.tree.toggle_help, opts('Help'))
end
vim.api.nvim_set_keymap("n", "<C-N>", ":NvimTreeToggle<CR>", { noremap = true, silent = true })
-- goto
vim.keymap.set("n", "gp", "<cmd>lua require('goto-preview').goto_preview_definition()<CR>", {noremap=true})
-- telescope
vim.api.nvim_set_keymap("n", "<leader>ff", "<cmd>Telescope find_files<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>.", "<cmd>Telescope find_files<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>fr", "<cmd>Telescope oldfiles<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>fg", "<cmd>Telescope live_grep<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>fb", "<cmd>Telescope buffers<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>fs", "<cmd>Telescope lsp_document_symbols<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>fr", "<cmd>Telescope lsp_references<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>fd", "<cmd>Telescope lsp_definitions<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>,", "<cmd>Telescope buffers<CR>", { noremap = true, silent = true })
-- rest
vim.api.nvim_set_keymap("n", "<leader>rr", "<Plug>RestNvim", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>rp", "<Plug>RestNvimPreview", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>rl", "<Plug>RestNvimLast", { noremap = true, silent = true })
-- aerial
vim.api.nvim_set_keymap("n", "<leader>aa", "<cmd>AerialToggle<CR>", { noremap = true, silent = true })
-- trouble
vim.api.nvim_set_keymap("n", "<leader>tt", "<cmd>TroubleToggle<CR>", { noremap = true, silent = true })
-- auto session
vim.api.nvim_set_keymap("n", "<leader>ss", "<cmd>SessionSave<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>sr", "<cmd>SessionRestore<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>sd", "<cmd>SessionDelete<CR>", { noremap = true, silent = true })
-- cokeline
vim.keymap.set("n", "<leader>bb", function()
require('cokeline.mappings').pick("focus")
end, { desc = "Pick a buffer to focus" })
vim.keymap.set("n", "<leader>bd", "<Plug>(cokeline-pick-close)", { silent = true })
-- terminal
vim.api.nvim_set_keymap("n", "<leader>tn", "<cmd>ToggleTerm direction=horizontal size=15<CR>", { noremap = true, silent = true })
vim.api.nvim_set_keymap("n", "<leader>tv", "<cmd>ToggleTerm direction=vertical size=70<CR>", { noremap = true, silent = true })
function _G.set_terminal_keymaps()
local opts = {buffer = 0}
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts) -- Exit to normal mode
vim.keymap.set('t', 'jk', [[<C-\><C-n>]], opts)
vim.keymap.set('t', '<C-h>', [[<Cmd>wincmd h<CR>]], opts)
vim.keymap.set('t', '<C-j>', [[<Cmd>wincmd j<CR>]], opts)
vim.keymap.set('t', '<C-k>', [[<Cmd>wincmd k<CR>]], opts)
vim.keymap.set('t', '<C-l>', [[<Cmd>wincmd l<CR>]], opts)
vim.keymap.set('t', '<C-w>', [[<C-\><C-n><C-w>]], opts)
end
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
-- oil
vim.keymap.set("n", "-", "<CMD>Oil<CR>", { desc = "Open parent directory" })

2
lua/mason-config.lua Normal file
View File

@ -0,0 +1,2 @@
require("mason").setup()
require("mason-lspconfig").setup()

271
lua/plugins.lua Normal file
View File

@ -0,0 +1,271 @@
return {
'williamboman/mason.nvim',
'williamboman/mason-lspconfig.nvim',
'neovim/nvim-lspconfig',
{ 'github/copilot.vim', branch = 'release' },
'hrsh7th/nvim-cmp',
'hrsh7th/cmp-nvim-lsp',
'hrsh7th/cmp-nvim-lua',
'hrsh7th/cmp-nvim-lsp-signature-help',
'hrsh7th/cmp-vsnip',
'hrsh7th/cmp-path',
'hrsh7th/cmp-buffer',
'hrsh7th/vim-vsnip',
{
'nvim-lualine/lualine.nvim',
dependencies = { 'nvim-tree/nvim-web-devicons' }
},
'nvim-tree/nvim-tree.lua',
'nvim-tree/nvim-web-devicons',
'navarasu/onedark.nvim',
'simrat39/rust-tools.nvim',
{ "ellisonleao/glow.nvim", config = function() require("glow").setup() end },
{
"willothy/nvim-cokeline",
dependencies = {
"nvim-lua/plenary.nvim", -- Required for v0.4.0+
"kyazdani42/nvim-web-devicons", -- If you want devicons
"stevearc/resession.nvim" -- Optional, for persistent history
},
config = true
},
{ 'saadparwaiz1/cmp_luasnip' },
({
"L3MON4D3/LuaSnip",
version = "v2.*",
run = "make install_jsregexp"
}),
{ 'nvim-lua/plenary.nvim' },
{ 'ThePrimeagen/harpoon' },
{ 'nvim-telescope/telescope.nvim', config = function() require('telescope').load_extension('aerial') end },
{
"ThePrimeagen/refactoring.nvim",
requires = {
{ "nvim-lua/plenary.nvim" },
{ "nvim-treesitter/nvim-treesitter" },
},
},
{ 'junegunn/fzf', run = ":call fzf#install()" },
{ 'junegunn/fzf.vim' },
{
'rmagatti/goto-preview',
config = function()
require('goto-preview').setup {}
end
},
{
"NeogitOrg/neogit",
dependencies = {
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim",
"sindrets/diffview.nvim",
},
config = true
},
{ 'mg979/vim-visual-multi' },
{ 'rhysd/git-messenger.vim' },
{ 'sindrets/diffview.nvim' },
{
'nvimdev/dashboard-nvim',
event = 'VimEnter',
config = function()
require('dashboard').setup {
-- config
}
end,
dependencies = { { 'nvim-tree/nvim-web-devicons' } }
},
{'kevinhwang91/nvim-ufo',
dependencies = 'kevinhwang91/promise-async',
config = function()
require('ufo').setup({
provider_selector = function(bufnr, filetype, buftype)
return {'treesitter', 'indent'}
end
})
end
},
{
'stevearc/oil.nvim',
opts = {},
-- Optional dependencies
dependencies = { "nvim-tree/nvim-web-devicons" },
},
{
'stevearc/aerial.nvim',
opts = {},
dependencies = {
"nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons"
},
},
{
"rest-nvim/rest.nvim",
dependencies = { { "nvim-lua/plenary.nvim" } },
config = function()
require("rest-nvim").setup({
-- Open request results in a horizontal split
result_split_horizontal = false,
-- Keep the http file buffer above|left when split horizontal|vertical
result_split_in_place = false,
-- Skip SSL verification, useful for unknown certificates
skip_ssl_verification = false,
-- Encode URL before making request
encode_url = true,
-- Highlight request on run
highlight = {
enabled = true,
timeout = 150,
},
result = {
-- toggle showing URL, HTTP info, headers at top the of result window
show_url = true,
-- show the generated curl command in case you want to launch
-- the same request via the terminal (can be verbose)
show_curl_command = false,
show_http_info = true,
show_headers = true,
-- executables or functions for formatting response body [optional]
-- set them to false if you want to disable them
formatters = {
json = "jq",
html = function(body)
return vim.fn.system({ "tidy", "-i", "-q", "-" }, body)
end
},
},
-- Jump to request line on run
jump_to_request = false,
env_file = '.env',
custom_dynamic_variables = {},
yank_dry_run = true,
})
end
},
{
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate",
config = function()
local configs = require("nvim-treesitter.configs")
configs.setup({
ensure_installed = { "c", "cpp", "lua", "vim", "vimdoc", "query", "elixir", "heex", "javascript", "html", "http", "json" },
sync_install = false,
highlight = { enable = true },
indent = { enable = true },
})
end
},
{
"folke/todo-comments.nvim",
dependencies = { "nvim-lua/plenary.nvim" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
},
{
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
},
},
{
'numToStr/Comment.nvim',
opts = {
-- add any options here
},
lazy = false,
},
'jiangmiao/auto-pairs',
{ 'luochen1990/rainbow' },
{ "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} },
'tpope/vim-surround',
'tpope/vim-sleuth',
'nmac427/guess-indent.nvim',
{
"SmiteshP/nvim-navic",
dependencies = { "neovim/nvim-lspconfig" },
},
{
"folke/which-key.nvim",
event = "VeryLazy",
init = function()
vim.o.timeout = true
vim.o.timeoutlen = 300
end,
opts = {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
},
'folke/neodev.nvim',
{ 'vladdoster/remember.nvim', config = [[ require('remember') ]] },
{
-- Adds git related signs to the gutter, as well as utilities for managing changes
'lewis6991/gitsigns.nvim',
opts = {
-- See `:help gitsigns.txt`
signs = {
add = { text = '+' },
change = { text = '~' },
delete = { text = '_' },
topdelete = { text = '' },
changedelete = { text = '~' },
},
on_attach = function(bufnr)
vim.keymap.set('n', '<leader>hp', require('gitsigns').preview_hunk, { buffer = bufnr, desc = 'Preview git hunk' })
-- don't override the built-in and fugitive keymaps
local gs = package.loaded.gitsigns
vim.keymap.set({ 'n', 'v' }, ']c', function()
if vim.wo.diff then
return ']c'
end
vim.schedule(function()
gs.next_hunk()
end)
return '<Ignore>'
end, { expr = true, buffer = bufnr, desc = 'Jump to next hunk' })
vim.keymap.set({ 'n', 'v' }, '[c', function()
if vim.wo.diff then
return '[c'
end
vim.schedule(function()
gs.prev_hunk()
end)
return '<Ignore>'
end, { expr = true, buffer = bufnr, desc = 'Jump to previous hunk' })
end,
},
},
{
"ahmedkhalf/project.nvim",
config = function()
require("project_nvim").setup {
-- your configuration comes here
-- or leave it empty to use the default settings
-- refer to the configuration section below
}
end
},
{
'stevearc/conform.nvim',
opts = {},
},
{
'rmagatti/auto-session',
config = function()
require("auto-session").setup {
log_level = "error",
auto_session_suppress_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
}
end
},
{ 'akinsho/toggleterm.nvim', version = "*", config = true }
}

6
lua/pyright.lua Normal file
View File

@ -0,0 +1,6 @@
lspconfig = require "lspconfig"
util = require "lspconfig/util"
lspconfig.pyright.setup {
filetypes = {"py"}
}

13
lua/rust.lua Normal file
View File

@ -0,0 +1,13 @@
local rt = require("rust-tools")
rt.setup({
server = {
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end,
},
})

0
lua/ufo-config.lua Normal file
View File