Initial Commit
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
site/
|
||||
12
example/.vimspector.json
Normal file
12
example/.vimspector.json
Normal file
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"configurations": {
|
||||
"launch": {
|
||||
"adapter": "CodeLLDB",
|
||||
"filetypes": [ "rust" ],
|
||||
"configuration": {
|
||||
"request": "launch",
|
||||
"program": "${workspaceRoot}/target/debug/app"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
182
init.lua
Normal file
182
init.lua
Normal file
@@ -0,0 +1,182 @@
|
||||
-- [[ init.lua]]
|
||||
-- [[ SPEED ]]
|
||||
vim.loader.enable()
|
||||
|
||||
-- Fix the clipboard
|
||||
vim.api.nvim_set_option('clipboard', 'unnamed')
|
||||
|
||||
-- Disable netrw for nvim-tree
|
||||
vim.g.loaded_netrw = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
-- LEADER
|
||||
vim.g.mapleader = ','
|
||||
vim.g.localleader = '\\'
|
||||
|
||||
-- IMPORTS
|
||||
require('vars') -- Variables
|
||||
require('opts') -- Options
|
||||
require('keys') -- Keymaps
|
||||
require('plug') -- Plugins
|
||||
|
||||
-- Colorscheme
|
||||
vim.cmd('colorscheme everforest')
|
||||
vim.cmd('hi Normal guibg=NONE') -- Have to do this manually for some reason
|
||||
|
||||
-- PLUGINS
|
||||
require('nvim-tree').setup{
|
||||
view = {
|
||||
preserve_window_proportions = true
|
||||
}
|
||||
}
|
||||
require('lualine').setup {
|
||||
options = {
|
||||
theme = 'everforest'
|
||||
},
|
||||
}
|
||||
|
||||
require('gitsigns_config')
|
||||
|
||||
require("mason").setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "",
|
||||
package_pending = "",
|
||||
package_uninstalled = "",
|
||||
},
|
||||
}
|
||||
})
|
||||
require("mason-lspconfig").setup()
|
||||
|
||||
-- Rust Config
|
||||
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 })
|
||||
vim.keymap.set('n', '<Leader>a', rt.code_action_group.code_action_group, { buffer = bufnr })
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
local sign = function(opts)
|
||||
vim.fn.sign_define(opts.name, {
|
||||
texthl = opts.name,
|
||||
text = opts.text,
|
||||
numhl = ''
|
||||
})
|
||||
end
|
||||
|
||||
sign({name = 'DiagnosticSignError', text = ''})
|
||||
sign({name = 'DiagnosticSignWarn', text = ''})
|
||||
sign({name = 'DiagnosticSignHint', text = ''})
|
||||
sign({name = 'DiagnosticSignInfo', text = ''})
|
||||
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
update_in_insert = true,
|
||||
underline = true,
|
||||
severity_sort = false,
|
||||
float = {
|
||||
border = 'rounded',
|
||||
source = 'always',
|
||||
header = '',
|
||||
prefix = '',
|
||||
},
|
||||
})
|
||||
|
||||
-- Completion Plugin Setup
|
||||
local cmp = require('cmp')
|
||||
cmp.setup({
|
||||
-- Enable LSP snippets
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
-- Add tab support
|
||||
['<S-Tab>'] = cmp.mapping.select_prev_item(),
|
||||
['<Tab>'] = cmp.mapping.select_next_item(),
|
||||
['<C-S-f>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true })
|
||||
},
|
||||
-- Installed sources:
|
||||
sources = {
|
||||
{ name = 'path' }, -- file paths
|
||||
{ name = 'nvim_lsp', keyword_length = 3 }, -- from language server
|
||||
{ name = 'nvim_lsp_signature_help'}, -- display function signatures with current parameter emphasized
|
||||
{ name = 'nvim_lua', keyword_length = 2}, -- complete neovim's Lua runtime API such vim.lsp.*
|
||||
{ name = 'buffer', keyword_length = 2 }, -- source current buffer
|
||||
{ name = 'vsnip', keyword_length = 2 }, -- nvim-cmp source for vim-vsnip
|
||||
{ name = 'calc'}, -- source for math calculation
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
formatting = {
|
||||
fields = {'menu', 'abbr', 'kind'},
|
||||
format = function(entry, item)
|
||||
local menu_icon ={
|
||||
nvim_lsp = 'λ',
|
||||
vsnip = '⋗',
|
||||
buffer = 'Ω',
|
||||
path = '🖫',
|
||||
}
|
||||
item.menu = menu_icon[entry.source.name]
|
||||
return item
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- Treesitter Plugin Setup
|
||||
require('nvim-treesitter.configs').setup {
|
||||
ensure_installed = { "lua", "rust", "toml" },
|
||||
auto_install = true,
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting=false,
|
||||
},
|
||||
ident = { enable = true },
|
||||
rainbow = {
|
||||
enable = true,
|
||||
extended_mode = true,
|
||||
max_file_lines = nil,
|
||||
}
|
||||
}
|
||||
|
||||
vim.g.barbar_auto_setup = false
|
||||
require('barbar').setup({
|
||||
sidebar_filetypes = {
|
||||
NvimTree = true
|
||||
}
|
||||
})
|
||||
|
||||
-- Hop
|
||||
require('hop').setup()
|
||||
|
||||
-- You dont need to set any of these options. These are the default ones. Only
|
||||
-- the loading is important
|
||||
require('telescope').setup {
|
||||
extensions = {
|
||||
fzf = {
|
||||
fuzzy = true, -- false will only do exact matching
|
||||
override_generic_sorter = true, -- override the generic sorter
|
||||
override_file_sorter = true, -- override the file sorter
|
||||
case_mode = "smart_case", -- or "ignore_case" or "respect_case"
|
||||
-- the default case_mode is "smart_case"
|
||||
}
|
||||
}
|
||||
}
|
||||
-- To get fzf loaded and working with telescope, you need to call
|
||||
-- load_extension, somewhere after setup function:
|
||||
require('telescope').load_extension('fzf')
|
||||
43
lua/barbar-keys.lua
Normal file
43
lua/barbar-keys.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
local map = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
-- Move to previous/next
|
||||
-- map('n', '<C-H>', '<Cmd>BufferPrevious<CR>', opts)
|
||||
-- map('n', '<C-L>', '<Cmd>BufferNext<CR>', opts)
|
||||
-- -- Re-order to previous/next
|
||||
-- map('n', '<A-<>', '<Cmd>BufferMovePrevious<CR>', opts)
|
||||
-- map('n', '<A->>', '<Cmd>BufferMoveNext<CR>', opts)
|
||||
-- Goto buffer in position...
|
||||
map('n', '<C-1>', '<Cmd>BufferGoto 1<CR>', opts)
|
||||
map('n', '<C-2>', '<Cmd>BufferGoto 2<CR>', opts)
|
||||
map('n', '<C-3>', '<Cmd>BufferGoto 3<CR>', opts)
|
||||
map('n', '<C-4>', '<Cmd>BufferGoto 4<CR>', opts)
|
||||
map('n', '<C-5>', '<Cmd>BufferGoto 5<CR>', opts)
|
||||
map('n', '<C-6>', '<Cmd>BufferGoto 6<CR>', opts)
|
||||
map('n', '<C-7>', '<Cmd>BufferGoto 7<CR>', opts)
|
||||
map('n', '<C-8>', '<Cmd>BufferGoto 8<CR>', opts)
|
||||
map('n', '<C-9>', '<Cmd>BufferGoto 9<CR>', opts)
|
||||
map('n', '<C-0>', '<Cmd>BufferLast<CR>', opts)
|
||||
-- Pin/unpin buffer
|
||||
-- map('n', '<C-p>', '<Cmd>BufferPin<CR>', opts)
|
||||
-- Close buffer
|
||||
map('n', '<C-S-c>', '<Cmd>BufferClose<CR>', opts)
|
||||
-- Wipeout buffer
|
||||
-- :BufferWipeout
|
||||
-- Close commands
|
||||
-- :BufferCloseAllButCurrent
|
||||
-- :BufferCloseAllButPinned
|
||||
-- :BufferCloseAllButCurrentOrPinned
|
||||
-- :BufferCloseBuffersLeft
|
||||
-- :BufferCloseBuffersRight
|
||||
-- Magic buffer-picking mode
|
||||
map('n', '<C-p>', '<Cmd>BufferPick<CR>', opts)
|
||||
-- Sort automatically by...
|
||||
-- map('n', '<C-Space>bb', '<Cmd>BufferOrderByBufferNumber<CR>', opts)
|
||||
-- map('n', '<C-Space>bd', '<Cmd>BufferOrderByDirectory<CR>', opts)
|
||||
-- map('n', '<C-Space>bl', '<Cmd>BufferOrderByLanguage<CR>', opts)
|
||||
-- map('n', '<C-Space>bw', '<Cmd>BufferOrderByWindowNumber<CR>', opts)
|
||||
|
||||
-- Other:
|
||||
-- :BarbarEnable - enables barbar (enabled by default)
|
||||
-- :BarbarDisable - very bad command, should never be used
|
||||
42
lua/gitsigns_config.lua
Normal file
42
lua/gitsigns_config.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
require('gitsigns').setup {
|
||||
signs = {
|
||||
add = { text = '+' },
|
||||
change = { text = '=' },
|
||||
delete = { text = '-' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = 'single',
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
yadm = {
|
||||
enable = false
|
||||
},
|
||||
}
|
||||
85
lua/keys.lua
Normal file
85
lua/keys.lua
Normal file
@@ -0,0 +1,85 @@
|
||||
-- [[ keys.lua ]]
|
||||
local g = vim.g
|
||||
local map = vim.api.nvim_set_keymap
|
||||
|
||||
-- Function to swap windows based on the direction
|
||||
_G.swap_window = function(direction)
|
||||
local cmd
|
||||
if direction == "left" then
|
||||
cmd = "wincmd h"
|
||||
elseif direction == "right" then
|
||||
cmd = "wincmd l"
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
local cur_win = vim.api.nvim_get_current_win()
|
||||
local cur_buf = vim.api.nvim_get_current_buf()
|
||||
|
||||
vim.cmd(cmd)
|
||||
|
||||
local other_win = vim.api.nvim_get_current_win()
|
||||
local other_buf = vim.api.nvim_get_current_buf()
|
||||
|
||||
if cur_win ~= other_win then
|
||||
vim.api.nvim_set_current_win(cur_win)
|
||||
vim.api.nvim_win_set_buf(cur_win, other_buf)
|
||||
vim.api.nvim_set_current_win(other_win)
|
||||
vim.api.nvim_win_set_buf(other_win, cur_buf)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
map('n', '<Leader>n', ':NvimTreeToggle<CR>', { silent = true })
|
||||
map('n', '_', ':split<CR>', {silent = true})
|
||||
map('n', '|', ':vsplit<CR>', {silent = true})
|
||||
|
||||
-- Remap pane navigation
|
||||
map('n', '<C-h>', '<C-w>h', {silent = true})
|
||||
map('n', '<C-j>', '<C-w>j', {silent = true})
|
||||
map('n', '<C-k>', '<C-w>k', {silent = true})
|
||||
map('n', '<C-l>', '<C-w>l', {silent = true})
|
||||
map('n', '<C-Left>', ':vertical resize +3<CR>', {silent = true})
|
||||
map('n', '<C-Right>', ':vertical resize -3<CR>', {silent = true})
|
||||
map('n', '<C-Up>', ':resize -3<CR>', {silent = true})
|
||||
map('n', '<C-Down>', ':resize +3<CR>', {silent = true})
|
||||
|
||||
-- Terminal Mappings
|
||||
-- map('n', '<Leader>nt', ':FloatermNew --name=guake --height=0.5 --width=0.5 --autoclose=2 zsh <CR>', {silent = true})
|
||||
map('n', '<Leader>t', ':FloatermToggle guake<CR>', {silent = true})
|
||||
map('t', '<Leader>t', '<C-\\><C-n>:q<CR>', {silent = true})
|
||||
map('t', '<Esc>', '<C-\\><C-n>', {silent = true})
|
||||
|
||||
|
||||
-- Vimspector
|
||||
vim.cmd([[
|
||||
nmap <F9> <cmd>call vimspector#Launch()<cr>
|
||||
nmap <F5> <cmd>call vimspector#StepOver()<cr>
|
||||
nmap <F8> <cmd>call vimspector#Reset()<cr>
|
||||
nmap <F11> <cmd>call vimspector#StepOver()<cr>)
|
||||
nmap <F12> <cmd>call vimspector#StepOut()<cr>)
|
||||
nmap <F10> <cmd>call vimspector#StepInto()<cr>)
|
||||
]])
|
||||
map('n', "<Leader>Db", ":call vimspector#ToggleBreakpoint()<cr>", {})
|
||||
map('n', "<Leader>Dw", ":call vimspector#AddWatch()<cr>", {})
|
||||
map('n', "<Leader>De", ":call vimspector#Evaluate()<cr>", {})
|
||||
|
||||
require('barbar-keys')
|
||||
|
||||
-- Swap windows
|
||||
map('n', '<C-S-h>', '<Cmd>lua _G.swap_window("left")<CR>', {silent = true})
|
||||
map('n', '<C-S-l>', '<Cmd>lua _G.swap_window("right")<CR>', {silent = true})
|
||||
|
||||
-- Close windows
|
||||
map('n', '<C-c>', ':confirm bd<CR>', {silent = true})
|
||||
|
||||
-- HOP
|
||||
map('n', '<Leader>h', ':HopWord<CR>', {silent = true})
|
||||
|
||||
-- Telescope
|
||||
map('n', '<Leader>ff', ':Telescope find_files<CR>', {silent = true})
|
||||
map('n', '<Leader>ft', ':Telescope live_grep<CR>', {silent = true})
|
||||
|
||||
-- Tagbar
|
||||
map('n', '<Leader>;', ':TagbarToggle<CR>', {silent = true})
|
||||
map('n', '<Leader>x', ':TroubleToggle workspace_diagnostics<CR>', {silent = true})
|
||||
2
lua/mason-config.lua
Normal file
2
lua/mason-config.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
require('mason').setup()
|
||||
require("mason-lspconfig").setup()
|
||||
108
lua/opts.lua
Normal file
108
lua/opts.lua
Normal file
@@ -0,0 +1,108 @@
|
||||
-- [[ opts.lua]]
|
||||
local opt = vim.opt
|
||||
local cmd = vim.api.nvim_command
|
||||
|
||||
-- [[ Context ]]
|
||||
opt.colorcolumn = '120'
|
||||
opt.number = true
|
||||
opt.relativenumber = true
|
||||
opt.scrolloff = 4
|
||||
opt.signcolumn = 'yes'
|
||||
|
||||
-- [[ Filetypes ]]
|
||||
opt.encoding = 'utf8'
|
||||
opt.fileencoding = 'utf8'
|
||||
|
||||
-- [[ Theme ]]
|
||||
opt.syntax = 'ON'
|
||||
opt.termguicolors = true
|
||||
|
||||
-- [[ Search ]]
|
||||
opt.ignorecase = true
|
||||
opt.smartcase = true
|
||||
opt.incsearch = true
|
||||
opt.hlsearch = false
|
||||
|
||||
-- [[ Whitespace ]]
|
||||
opt.expandtab = true
|
||||
opt.shiftwidth = 4
|
||||
opt.softtabstop = 4
|
||||
opt.tabstop = 4
|
||||
|
||||
-- [[ Splits ]]
|
||||
opt.splitright = true
|
||||
opt.splitbelow = true
|
||||
|
||||
-- [[ Folding ]]
|
||||
opt.foldlevelstart = 99
|
||||
|
||||
|
||||
-- -- NVIM-TREE Nonsense
|
||||
-- local function tab_win_closed(winnr)
|
||||
-- local api = require"nvim-tree.api"
|
||||
-- local tabnr = vim.api.nvim_win_get_tabpage(winnr)
|
||||
-- local bufnr = vim.api.nvim_win_get_buf(winnr)
|
||||
-- local buf_info = vim.fn.getbufinfo(bufnr)[1]
|
||||
-- local tab_wins = vim.tbl_filter(function(w) return w~=winnr end, vim.api.nvim_tabpage_list_wins(tabnr))
|
||||
-- local tab_bufs = vim.tbl_map(vim.api.nvim_win_get_buf, tab_wins)
|
||||
-- if buf_info.name:match(".*NvimTree_%d*$") then -- close buffer was nvim tree
|
||||
-- -- Close all nvim tree on :q
|
||||
-- if not vim.tbl_isempty(tab_bufs) then -- and was not the last window (not closed automatically by code below)
|
||||
-- api.tree.close()
|
||||
-- end
|
||||
-- else -- else closed buffer was normal buffer
|
||||
-- if #tab_bufs == 1 then -- if there is only 1 buffer left in the tab
|
||||
-- local last_buf_info = vim.fn.getbufinfo(tab_bufs[1])[1]
|
||||
-- if last_buf_info.name:match(".*NvimTree_%d*$") then -- and that buffer is nvim tree
|
||||
-- vim.schedule(function ()
|
||||
-- if #vim.api.nvim_list_wins() == 1 then -- if its the last buffer in vim
|
||||
-- vim.cmd "quit" -- then close all of vim
|
||||
-- else -- else there are more tabs open
|
||||
-- vim.api.nvim_win_close(tab_wins[1], true) -- then close only the tab
|
||||
-- end
|
||||
-- end)
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
-- end
|
||||
|
||||
-- vim.api.nvim_create_autocmd("WinClosed", {
|
||||
-- callback = function ()
|
||||
-- local winnr = tonumber(vim.fn.expand("<amatch>"))
|
||||
-- vim.schedule_wrap(tab_win_closed(winnr))
|
||||
-- end,
|
||||
-- nested = true
|
||||
-- })
|
||||
|
||||
|
||||
-- Set completeopt to have a better completion experience
|
||||
-- :help completeopt
|
||||
-- menuone: popup even when there's only one match
|
||||
-- noinsert: Do not insert text until a selection is made
|
||||
-- noselect: Do not select, force to select one from the menu
|
||||
-- shortness: avoid showing extra messages when using completion
|
||||
-- updatetime: set updatetime for CursorHold
|
||||
opt.completeopt = {'menuone', 'noselect', 'noinsert'}
|
||||
--opt.shortmess = opt.shortmess + { c = true }
|
||||
vim.api.nvim_set_option('updatetime', 50)
|
||||
|
||||
-- Fixed column for diagnostics to appear
|
||||
-- Show autodiagnostic popup on cursor hover_range
|
||||
-- Goto previous / next diagnostic warning / error
|
||||
-- Show inlay_hints more frequently
|
||||
vim.cmd([[
|
||||
set signcolumn=yes
|
||||
autocmd CursorHold * lua vim.diagnostic.open_float(nil, { focusable = false })
|
||||
]])
|
||||
|
||||
-- Treesitter folding
|
||||
vim.wo.foldmethod = 'expr'
|
||||
vim.wo.foldexpr = 'nvim_treesitter#foldexpr()'
|
||||
|
||||
-- Vimspector Options
|
||||
vim.cmd([[
|
||||
let g:vimspector_sidebar_width = 85
|
||||
let g:vimspector_bottombar_height = 15
|
||||
let g:vimspector_terminal_maxwidth = 70
|
||||
]])
|
||||
|
||||
111
lua/plug.lua
Normal file
111
lua/plug.lua
Normal file
@@ -0,0 +1,111 @@
|
||||
-- [[ plug.lua ]]
|
||||
|
||||
-- Function to check if Packer is installed and install it if not found
|
||||
local function ensure_packer_installed()
|
||||
local install_path = vim.fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
|
||||
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
|
||||
vim.fn.system({ 'git', 'clone', 'https://github.com/wbthomason/packer.nvim', install_path })
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
-- Function to install the plugins with Packer
|
||||
local function install_plugins_with_packer(just_installed_packer)
|
||||
require('packer').startup(function(use)
|
||||
-- Your existing plugin configurations
|
||||
-- Replace the 'use' statements in your 'plug.lua' file with the ones here
|
||||
-- For example:
|
||||
-- use 'kyazdani42/nvim-tree.lua'
|
||||
-- use 'hoob3rt/lualine.nvim'
|
||||
use 'wbthomason/packer.nvim'
|
||||
|
||||
-- [[ Navigation and UI ]]
|
||||
use 'nvim-tree/nvim-web-devicons'
|
||||
use 'nvim-tree/nvim-tree.lua'
|
||||
use 'romgrk/barbar.nvim' -- For the love of good I need good tabpage headers
|
||||
|
||||
-- use 'Yggdroot/indentLine'
|
||||
|
||||
-- [[ Git and VCS ]]
|
||||
use 'tpope/vim-fugitive' -- More git stuff
|
||||
use 'lewis6991/gitsigns.nvim' -- Added/Removed/Modified Git Lines and Such
|
||||
--use 'junegunn/gv.vim' -- Idk something with git
|
||||
|
||||
-- [[ Basic Code Editing ]]
|
||||
use 'tpope/vim-commentary' -- Uncomment/Comment lines of code with gc
|
||||
use {
|
||||
'phaazon/hop.nvim',
|
||||
branch = 'v2',
|
||||
config = function()
|
||||
require('hop').setup({keys = 'etovxqpdygfblzhckisuran' })
|
||||
end
|
||||
}
|
||||
|
||||
-- [[ Rust & LSP ]]
|
||||
use 'williamboman/mason.nvim'
|
||||
use 'williamboman/mason-lspconfig.nvim'
|
||||
use 'neovim/nvim-lspconfig'
|
||||
use 'simrat39/rust-tools.nvim'
|
||||
use 'nvim-treesitter/nvim-treesitter'
|
||||
|
||||
-- [[ Debugging/CodeLLDB ]]
|
||||
use 'puremourning/vimspector'
|
||||
|
||||
---- [[ Completion Framework ]]
|
||||
use 'hrsh7th/nvim-cmp'
|
||||
|
||||
---- [[ LSP Completion Source ]]
|
||||
use 'hrsh7th/cmp-nvim-lsp'
|
||||
|
||||
---- [[ Useful Completion Sources ]]
|
||||
use 'hrsh7th/cmp-nvim-lua'
|
||||
use 'hrsh7th/cmp-nvim-lsp-signature-help'
|
||||
use 'hrsh7th/cmp-vsnip'
|
||||
use 'hrsh7th/cmp-path'
|
||||
use 'hrsh7th/cmp-buffer'
|
||||
use 'hrsh7th/vim-vsnip'
|
||||
|
||||
-- [[ Terminal ]]
|
||||
use 'voldikss/vim-floaterm'
|
||||
|
||||
-- [[ Theme ]]
|
||||
use 'mhinz/vim-startify'
|
||||
use 'DanilaMihailov/beacon.nvim'
|
||||
use 'nvim-lualine/lualine.nvim'
|
||||
use 'Mofiqul/dracula.nvim'
|
||||
use 'ellisonleao/gruvbox.nvim'
|
||||
use 'sainnhe/everforest'
|
||||
use {
|
||||
'nvim-telescope/telescope-fzf-native.nvim',
|
||||
run = 'cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release && \
|
||||
cmake --build build --config Release && \
|
||||
cmake --install build --prefix build'
|
||||
}
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
tag = '0.1.1',
|
||||
requires = {
|
||||
{'nvim-lua/plenary.nvim'}
|
||||
}
|
||||
}
|
||||
use 'preservim/tagbar'
|
||||
use {
|
||||
"folke/trouble.nvim",
|
||||
requires = "nvim-tree/nvim-web-devicons",
|
||||
config = function() require("trouble").setup {
|
||||
}
|
||||
end
|
||||
}
|
||||
end)
|
||||
|
||||
-- Automatically install plugins if there are any missing, and if packer was just installed
|
||||
if just_installed_packer then
|
||||
require('packer').sync()
|
||||
end
|
||||
end
|
||||
|
||||
-- Ensure Packer is installed and install plugins
|
||||
local just_installed_packer = ensure_packer_installed()
|
||||
install_plugins_with_packer(just_installed_packer)
|
||||
|
||||
4
lua/rust-analyzer.lua
Normal file
4
lua/rust-analyzer.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
-- Require LSP config which we can use to attach rust-analyzer
|
||||
lspconfig = require 'lspconfig'
|
||||
util = require 'lspconfig/util'
|
||||
|
||||
21
lua/vars.lua
Normal file
21
lua/vars.lua
Normal file
@@ -0,0 +1,21 @@
|
||||
-- [[ vars.lua ]]
|
||||
|
||||
local g = vim.g
|
||||
g.t_co = 256
|
||||
g.background = 'dark'
|
||||
|
||||
-- Update the packpath
|
||||
local packer_path = vim.fn.stdpath('config') .. '/site'
|
||||
vim.o.packpath = vim.o.packpath .. ',' .. packer_path
|
||||
|
||||
-- NVIM-TREE Options
|
||||
g.nvim_tree_git_hl = 1
|
||||
g.nvim_tree_add_trailing = 0
|
||||
g.nvim_tree_highlight_opened_files = 1
|
||||
g.nvim_tree_indent_markers = 1
|
||||
g.nvim_tree_show_icons = {
|
||||
git = 1,
|
||||
folders = 1,
|
||||
files = 1,
|
||||
folder_arrows = 1
|
||||
}
|
||||
229
plugin/packer_compiled.lua
Normal file
229
plugin/packer_compiled.lua
Normal file
@@ -0,0 +1,229 @@
|
||||
-- Automatically generated packer.nvim plugin loader code
|
||||
|
||||
if vim.api.nvim_call_function('has', {'nvim-0.5'}) ~= 1 then
|
||||
vim.api.nvim_command('echohl WarningMsg | echom "Invalid Neovim version for packer.nvim! | echohl None"')
|
||||
return
|
||||
end
|
||||
|
||||
vim.api.nvim_command('packadd packer.nvim')
|
||||
|
||||
local no_errors, error_msg = pcall(function()
|
||||
|
||||
_G._packer = _G._packer or {}
|
||||
_G._packer.inside_compile = true
|
||||
|
||||
local time
|
||||
local profile_info
|
||||
local should_profile = false
|
||||
if should_profile then
|
||||
local hrtime = vim.loop.hrtime
|
||||
profile_info = {}
|
||||
time = function(chunk, start)
|
||||
if start then
|
||||
profile_info[chunk] = hrtime()
|
||||
else
|
||||
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
|
||||
end
|
||||
end
|
||||
else
|
||||
time = function(chunk, start) end
|
||||
end
|
||||
|
||||
local function save_profiles(threshold)
|
||||
local sorted_times = {}
|
||||
for chunk_name, time_taken in pairs(profile_info) do
|
||||
sorted_times[#sorted_times + 1] = {chunk_name, time_taken}
|
||||
end
|
||||
table.sort(sorted_times, function(a, b) return a[2] > b[2] end)
|
||||
local results = {}
|
||||
for i, elem in ipairs(sorted_times) do
|
||||
if not threshold or threshold and elem[2] > threshold then
|
||||
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
|
||||
end
|
||||
end
|
||||
if threshold then
|
||||
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
|
||||
end
|
||||
|
||||
_G._packer.profile_output = results
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], true)
|
||||
local package_path_str = "/Users/aargonian/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?.lua;/Users/aargonian/.cache/nvim/packer_hererocks/2.1.0-beta3/share/lua/5.1/?/init.lua;/Users/aargonian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?.lua;/Users/aargonian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/luarocks/rocks-5.1/?/init.lua"
|
||||
local install_cpath_pattern = "/Users/aargonian/.cache/nvim/packer_hererocks/2.1.0-beta3/lib/lua/5.1/?.so"
|
||||
if not string.find(package.path, package_path_str, 1, true) then
|
||||
package.path = package.path .. ';' .. package_path_str
|
||||
end
|
||||
|
||||
if not string.find(package.cpath, install_cpath_pattern, 1, true) then
|
||||
package.cpath = package.cpath .. ';' .. install_cpath_pattern
|
||||
end
|
||||
|
||||
time([[Luarocks path setup]], false)
|
||||
time([[try_loadstring definition]], true)
|
||||
local function try_loadstring(s, component, name)
|
||||
local success, result = pcall(loadstring(s), name, _G.packer_plugins[name])
|
||||
if not success then
|
||||
vim.schedule(function()
|
||||
vim.api.nvim_notify('packer.nvim: Error running ' .. component .. ' for ' .. name .. ': ' .. result, vim.log.levels.ERROR, {})
|
||||
end)
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
time([[try_loadstring definition]], false)
|
||||
time([[Defining packer_plugins]], true)
|
||||
_G.packer_plugins = {
|
||||
["barbar.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/barbar.nvim",
|
||||
url = "https://github.com/romgrk/barbar.nvim"
|
||||
},
|
||||
["beacon.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/beacon.nvim",
|
||||
url = "https://github.com/DanilaMihailov/beacon.nvim"
|
||||
},
|
||||
["cmp-buffer"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/cmp-buffer",
|
||||
url = "https://github.com/hrsh7th/cmp-buffer"
|
||||
},
|
||||
["cmp-nvim-lsp"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
|
||||
},
|
||||
["cmp-nvim-lsp-signature-help"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp-signature-help",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lsp-signature-help"
|
||||
},
|
||||
["cmp-nvim-lua"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/cmp-nvim-lua",
|
||||
url = "https://github.com/hrsh7th/cmp-nvim-lua"
|
||||
},
|
||||
["cmp-path"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/cmp-path",
|
||||
url = "https://github.com/hrsh7th/cmp-path"
|
||||
},
|
||||
["cmp-vsnip"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/cmp-vsnip",
|
||||
url = "https://github.com/hrsh7th/cmp-vsnip"
|
||||
},
|
||||
["dracula.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/dracula.nvim",
|
||||
url = "https://github.com/Mofiqul/dracula.nvim"
|
||||
},
|
||||
["gitsigns.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
|
||||
url = "https://github.com/lewis6991/gitsigns.nvim"
|
||||
},
|
||||
["gruvbox.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/gruvbox.nvim",
|
||||
url = "https://github.com/ellisonleao/gruvbox.nvim"
|
||||
},
|
||||
["lualine.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/lualine.nvim",
|
||||
url = "https://github.com/nvim-lualine/lualine.nvim"
|
||||
},
|
||||
["mason-lspconfig.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/mason-lspconfig.nvim",
|
||||
url = "https://github.com/williamboman/mason-lspconfig.nvim"
|
||||
},
|
||||
["mason.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/mason.nvim",
|
||||
url = "https://github.com/williamboman/mason.nvim"
|
||||
},
|
||||
["nvim-cmp"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/nvim-cmp",
|
||||
url = "https://github.com/hrsh7th/nvim-cmp"
|
||||
},
|
||||
["nvim-lspconfig"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
|
||||
url = "https://github.com/neovim/nvim-lspconfig"
|
||||
},
|
||||
["nvim-tree.lua"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
|
||||
url = "https://github.com/nvim-tree/nvim-tree.lua"
|
||||
},
|
||||
["nvim-treesitter"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
|
||||
url = "https://github.com/nvim-treesitter/nvim-treesitter"
|
||||
},
|
||||
["nvim-web-devicons"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/nvim-web-devicons",
|
||||
url = "https://github.com/nvim-tree/nvim-web-devicons"
|
||||
},
|
||||
["packer.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/packer.nvim",
|
||||
url = "https://github.com/wbthomason/packer.nvim"
|
||||
},
|
||||
["rust-tools.nvim"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/rust-tools.nvim",
|
||||
url = "https://github.com/simrat39/rust-tools.nvim"
|
||||
},
|
||||
["vim-commentary"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/vim-commentary",
|
||||
url = "https://github.com/tpope/vim-commentary"
|
||||
},
|
||||
["vim-floaterm"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/vim-floaterm",
|
||||
url = "https://github.com/voldikss/vim-floaterm"
|
||||
},
|
||||
["vim-fugitive"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/vim-fugitive",
|
||||
url = "https://github.com/tpope/vim-fugitive"
|
||||
},
|
||||
["vim-startify"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/vim-startify",
|
||||
url = "https://github.com/mhinz/vim-startify"
|
||||
},
|
||||
["vim-vsnip"] = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/vim-vsnip",
|
||||
url = "https://github.com/hrsh7th/vim-vsnip"
|
||||
},
|
||||
vimspector = {
|
||||
loaded = true,
|
||||
path = "/Users/aargonian/.local/share/nvim/site/pack/packer/start/vimspector",
|
||||
url = "https://github.com/puremourning/vimspector"
|
||||
}
|
||||
}
|
||||
|
||||
time([[Defining packer_plugins]], false)
|
||||
|
||||
_G._packer.inside_compile = false
|
||||
if _G._packer.needs_bufread == true then
|
||||
vim.cmd("doautocmd BufRead")
|
||||
end
|
||||
_G._packer.needs_bufread = false
|
||||
|
||||
if should_profile then save_profiles() end
|
||||
|
||||
end)
|
||||
|
||||
if not no_errors then
|
||||
error_msg = error_msg:gsub('"', '\\"')
|
||||
vim.api.nvim_command('echohl ErrorMsg | echom "Error in packer_compiled: '..error_msg..'" | echom "Please check your config for correctness" | echohl None')
|
||||
end
|
||||
Reference in New Issue
Block a user