init files
This commit is contained in:
commit
c84f8549bb
27 changed files with 858 additions and 0 deletions
32
ginit.vim
Normal file
32
ginit.vim
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
" Enable Mouse
|
||||
set mouse=a
|
||||
|
||||
" Set Editor Font
|
||||
if exists(':GuiFont')
|
||||
" Use GuiFont! to ignore font errors
|
||||
" GuiFont! CaskaydiaCove Nerd Font:h15
|
||||
GuiFont! CaskaydiaCove Nerd Font:h13
|
||||
endif
|
||||
|
||||
" Disable GUI Tabline
|
||||
if exists(':GuiTabline')
|
||||
GuiTabline 0
|
||||
endif
|
||||
|
||||
" Disable GUI Popupmenu
|
||||
if exists(':GuiPopupmenu')
|
||||
GuiPopupmenu 0
|
||||
endif
|
||||
|
||||
" Enable GUI ScrollBar
|
||||
if exists(':GuiScrollBar')
|
||||
GuiScrollBar 0
|
||||
endif
|
||||
|
||||
" call GuiWindowMaximized(1)
|
||||
|
||||
" Right Click Context Menu (Copy-Cut-Paste)
|
||||
nnoremap <silent><RightMouse> :call GuiShowContextMenu()<CR>
|
||||
inoremap <silent><RightMouse> <Esc>:call GuiShowContextMenu()<CR>
|
||||
xnoremap <silent><RightMouse> :call GuiShowContextMenu()<CR>gv
|
||||
snoremap <silent><RightMouse> <C-G>:call GuiShowContextMenu()<CR>gv
|
||||
169
init.lua
Normal file
169
init.lua
Normal file
|
|
@ -0,0 +1,169 @@
|
|||
-- init.lua — migrated from packer.nvim to lazy.nvim
|
||||
-- NOTE: impatient.nvim is no longer needed on modern Neovim (builtin module caching)
|
||||
|
||||
-- =====================
|
||||
-- Core options & globals
|
||||
-- =====================
|
||||
vim.g.mapleader = '\\'
|
||||
vim.opt.termguicolors = true
|
||||
vim.g.coq_settings = { ['auto_start'] = 'shut-up' }
|
||||
vim.g.vimtex_view_general_viewer = 'okular'
|
||||
vim.g.vimtex_view_general_options = '-unique file:@pdf\\#src:@line@tex'
|
||||
vim.g.auto_save = 1
|
||||
vim.opt.number = true
|
||||
vim.opt.foldmethod = 'expr'
|
||||
vim.opt.foldexpr = 'nvim_treesiter#foldexpr()'
|
||||
vim.opt.foldenable = true
|
||||
vim.opt.foldlevel = 5
|
||||
vim.opt.cursorline = true
|
||||
vim.g.vimtex_fold_enabled = true
|
||||
vim.g.vimtex_indent_enabled = true
|
||||
vim.g.vimtex_indent_bib_enabled = true
|
||||
vim.g.vimtex_quickfix_autoclose_after_keystrokes = 5
|
||||
vim.g.startify_session_dir = vim.fn.stdpath('data') .. '/sessions'
|
||||
vim.cmd [[set termguicolors
|
||||
set shell=/usr/bin/zsh]]
|
||||
vim.cmd [[:setlocal spell spelllang=en_us]]
|
||||
vim.cmd [[let g:auto_save_events = ["InsertLeave", "TextChanged"] ]]
|
||||
vim.cmd [[let g:startify_custom_header = [] ]]
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { buffer = 0 }
|
||||
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
||||
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)
|
||||
end
|
||||
|
||||
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
end
|
||||
vim.o.updatetime = 250
|
||||
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
|
||||
vim.diagnostic.config({
|
||||
virtual_text = { source = "always" },
|
||||
float = { source = "always" },
|
||||
})
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = false,
|
||||
})
|
||||
|
||||
vim.cmd [[
|
||||
set guifont=CaskaydiaCove\ Nerd\ Font:h19
|
||||
set signcolumn=yes
|
||||
syntax enable
|
||||
nnoremap <silent> gb :BufferLinePick<CR>
|
||||
nnoremap <C-p> :Telescope<CR>
|
||||
" Paste system clipboard with Ctrl + v
|
||||
inoremap <C-v> <ESC>"+p
|
||||
vnoremap <C-v> d"+gP<ESC>
|
||||
cnoremap <C-v> <C-r>+
|
||||
|
||||
" Cut to system clipboard with Ctrl + x
|
||||
vnoremap <C-x> "+d
|
||||
inoremap <C-x> <ESC>"+ddi
|
||||
|
||||
" Copy to system clipboard with Ctr + c
|
||||
vnoremap <C-c> "+y
|
||||
nnoremap <C-c> "+yy
|
||||
inoremap <C-c> <ESC>"+yyi
|
||||
nnoremap <space> :noh<cr>
|
||||
nnoremap <C-n> :NvimTreeToggle<CR>
|
||||
" change directory to current file
|
||||
nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR>
|
||||
" au InsertLeave * lua require('lint').try_lint()
|
||||
]]
|
||||
|
||||
-- vim.cmd [[colorscheme gruvbox8_hard]]
|
||||
vim.cmd [[set nocompatible]]
|
||||
vim.cmd [[
|
||||
if has('nvim')
|
||||
autocmd TabNewEntered * Startify
|
||||
else
|
||||
autocmd BufWinEnter *
|
||||
if !exists('t:startify_new_tab') && empty(expand('%')) && empty(&l:buftype) && &l:modifiable | let t:startify_new_tab = 1 | Startify |
|
||||
endif
|
||||
endif
|
||||
]]
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
-- require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
if vim.g.neovide then
|
||||
vim.o.guifont = "CaskaydiaCove Nerd Font:h14"
|
||||
end
|
||||
local function dedup_diagnostics(_, result, ctx, config)
|
||||
if not result or not result.diagnostics then
|
||||
return
|
||||
end
|
||||
local filtered = {}
|
||||
local by_line = {}
|
||||
for _, diag in ipairs(result.diagnostics) do
|
||||
local lnum = diag.range.start.line
|
||||
if not by_line[lnum] or diag.severity < by_line[lnum].severity then
|
||||
by_line[lnum] = diag
|
||||
end
|
||||
end
|
||||
for _, diag in pairs(by_line) do
|
||||
table.insert(filtered, diag)
|
||||
end
|
||||
result.diagnostics = filtered
|
||||
vim.lsp.diagnostic.on_publish_diagnostics(_, result, ctx, config)
|
||||
end
|
||||
|
||||
vim.lsp.handlers["textDocument/publishDiagnostics"] = dedup_diagnostics
|
||||
local set = vim.keymap.set
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
||||
set('n', 'gD', vim.lsp.buf.declaration, opts)
|
||||
set('n', 'gd', vim.lsp.buf.definition, opts)
|
||||
set('n', 'K', vim.lsp.buf.hover, opts)
|
||||
set('n', 'gi', vim.lsp.buf.implementation, opts)
|
||||
set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
|
||||
set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, opts)
|
||||
set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, opts)
|
||||
set('n', '<leader>wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end, opts)
|
||||
set('n', '<leader>D', vim.lsp.buf.type_definition, opts)
|
||||
set('n', '<leader>rn', vim.lsp.buf.rename, opts)
|
||||
set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, opts)
|
||||
set('n', 'gr', vim.lsp.buf.references, opts)
|
||||
set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
set('n', '<leader>q', vim.diagnostic.setloclist, opts)
|
||||
set('n', '<leader>e', vim.diagnostic.open_float, opts)
|
||||
set('n', '<leader>f', function() vim.lsp.buf.format { async = true } end, opts)
|
||||
|
||||
|
||||
-- =====================
|
||||
-- lazy.nvim bootstrap
|
||||
-- =====================
|
||||
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)
|
||||
|
||||
-- =====================
|
||||
-- Plugins (lazy.nvim)
|
||||
-- =====================
|
||||
require("lazy").setup("plugins")
|
||||
298
init.lua.bak
Normal file
298
init.lua.bak
Normal file
|
|
@ -0,0 +1,298 @@
|
|||
|
||||
-- init.lua — migrated from packer.nvim to lazy.nvim
|
||||
-- NOTE: impatient.nvim is no longer needed on modern Neovim (builtin module caching)
|
||||
|
||||
-- =====================
|
||||
-- Core options & globals
|
||||
-- =====================
|
||||
vim.g.mapleader = '\\'
|
||||
vim.opt.termguicolors = true
|
||||
vim.g.coq_settings = { ['auto_start'] = 'shut-up'}
|
||||
vim.g.vimtex_view_general_viewer = 'okular'
|
||||
vim.g.vimtex_view_general_options = '-unique file:@pdf\\#src:@line@tex'
|
||||
vim.g.auto_save = 1
|
||||
vim.opt.number = true
|
||||
vim.opt.foldmethod = 'indent'
|
||||
vim.opt.cursorline = true
|
||||
vim.g.vimtex_fold_enabled = true
|
||||
vim.g.vimtex_indent_enabled = true
|
||||
vim.g.vimtex_indent_bib_enabled = true
|
||||
vim.g.vimtex_quickfix_autoclose_after_keystrokes = 5
|
||||
vim.cmd [[set termguicolors
|
||||
set shell=/usr/bin/zsh]]
|
||||
vim.cmd [[:setlocal spell spelllang=en_us]]
|
||||
vim.cmd [[let g:auto_save_events = ["InsertLeave", "TextChanged"] ]]
|
||||
vim.cmd [[let g:startify_custom_header = [] ]]
|
||||
|
||||
function _G.set_terminal_keymaps()
|
||||
local opts = { buffer = 0 }
|
||||
vim.keymap.set('t', '<esc>', [[<C-\><C-n>]], opts)
|
||||
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)
|
||||
end
|
||||
|
||||
-- if you only want these mappings for toggle term use term://*toggleterm#* instead
|
||||
vim.cmd('autocmd! TermOpen term://* lua set_terminal_keymaps()')
|
||||
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
for type, icon in pairs(signs) do
|
||||
local hl = "DiagnosticSign" .. type
|
||||
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
|
||||
end
|
||||
vim.o.updatetime = 250
|
||||
vim.cmd [[autocmd CursorHold,CursorHoldI * lua vim.diagnostic.open_float(nil, {focus=false})]]
|
||||
vim.diagnostic.config({
|
||||
virtual_text = { source = "always" },
|
||||
float = { source = "always" },
|
||||
})
|
||||
vim.diagnostic.config({
|
||||
virtual_text = false,
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = false,
|
||||
})
|
||||
|
||||
vim.cmd [[
|
||||
set guifont=CaskaydiaCove\ Nerd\ Font:h19
|
||||
set signcolumn=yes
|
||||
syntax enable
|
||||
nnoremap <silent> gb :BufferLinePick<CR>
|
||||
nnoremap <C-p> :Telescope<CR>
|
||||
" Paste system clipboard with Ctrl + v
|
||||
inoremap <C-v> <ESC>"+p
|
||||
vnoremap <C-v> d"+gP<ESC>
|
||||
cnoremap <C-v> <C-r>+
|
||||
|
||||
" Cut to system clipboard with Ctrl + x
|
||||
vnoremap <C-x> "+d
|
||||
inoremap <C-x> <ESC>"+ddi
|
||||
|
||||
" Copy to system clipboard with Ctr + c
|
||||
vnoremap <C-c> "+y
|
||||
nnoremap <C-c> "+yy
|
||||
inoremap <C-c> <ESC>"+yyi
|
||||
nnoremap <space> :noh<cr>
|
||||
nnoremap <C-n> :NvimTreeToggle<CR>
|
||||
" change directory to current file
|
||||
nnoremap <leader>cd :cd %:p:h<CR>:pwd<CR>
|
||||
" au InsertLeave * lua require('lint').try_lint()
|
||||
]]
|
||||
|
||||
-- vim.cmd [[colorscheme gruvbox8_hard]]
|
||||
vim.cmd [[set nocompatible]]
|
||||
vim.cmd [[
|
||||
if has('nvim')
|
||||
autocmd TabNewEntered * Startify
|
||||
else
|
||||
autocmd BufWinEnter *
|
||||
if !exists('t:startify_new_tab') && empty(expand('%')) && empty(&l:buftype) && &l:modifiable | let t:startify_new_tab = 1 | Startify |
|
||||
endif
|
||||
endif
|
||||
]]
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWritePost" }, {
|
||||
callback = function()
|
||||
-- require("lint").try_lint()
|
||||
end,
|
||||
})
|
||||
|
||||
if vim.g.neovide then
|
||||
vim.o.guifont = "CaskaydiaCove Nerd Font:h14"
|
||||
end
|
||||
|
||||
-- LSP default keybindings
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.api.nvim_set_keymap('n', '<space>e', '<cmd>lua vim.diagnostic.open_float()<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', '[d', '<cmd>lua vim.diagnostic.goto_prev()<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', ']d', '<cmd>lua vim.diagnostic.goto_next()<CR>', opts)
|
||||
vim.api.nvim_set_keymap('n', '<space>q', '<cmd>lua vim.diagnostic.setloclist()<CR>', opts)
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<localleader>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gf', vim.lsp.buf.format, opts)
|
||||
end
|
||||
|
||||
vim.fn.sign_define('DapBreakpoint',{ text ='🟥', texthl ='', linehl ='', numhl =''})
|
||||
vim.fn.sign_define('DapStopped',{ text ='▶️', texthl ='', linehl ='', numhl =''})
|
||||
|
||||
-- =====================
|
||||
-- lazy.nvim bootstrap
|
||||
-- =====================
|
||||
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)
|
||||
|
||||
-- =====================
|
||||
-- Plugins (lazy.nvim)
|
||||
-- =====================
|
||||
require('lazy').setup({
|
||||
-- Icons (used by multiple plugins)
|
||||
{ 'nvim-tree/nvim-web-devicons', lazy = true },
|
||||
|
||||
-- Statusline
|
||||
|
||||
-- Bufferline
|
||||
{
|
||||
'akinsho/bufferline.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require('bufferline').setup({
|
||||
options = {
|
||||
always_show_bufferline = true,
|
||||
separator_style = 'thin',
|
||||
show_close_icon = false,
|
||||
numbers = 'buffer_id',
|
||||
enforce_regular_tabs = true,
|
||||
offsets = { { filetype = 'NvimTree', text = 'File Explorer', highlight = 'Directory' } },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Start screen
|
||||
{ 'mhinz/vim-startify' },
|
||||
|
||||
-- File explorer
|
||||
{
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require('nvim-tree').setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Treesitter
|
||||
-- { 'nvim-treesitter/nvim-treesitter', build = ':TSUpdate' },
|
||||
|
||||
-- Orgmode
|
||||
{
|
||||
'nvim-orgmode/orgmode',
|
||||
config = function()
|
||||
require('orgmode').setup({
|
||||
org_agenda_files = '~/org/*'
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Org bullets
|
||||
{
|
||||
'akinsho/org-bullets.nvim',
|
||||
config = function()
|
||||
require('org-bullets').setup({
|
||||
checkboxes = {
|
||||
half = { '', 'OrgTSCheckboxHalfChecked' },
|
||||
done = { '✓', 'OrgDone' },
|
||||
todo = { 'x', 'OrgTODO' },
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Auto save
|
||||
{ '907th/vim-auto-save' },
|
||||
|
||||
-- Telescope
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
},
|
||||
|
||||
-- VimTeX
|
||||
{ 'lervag/vimtex' },
|
||||
|
||||
-- ALE (linting)
|
||||
-- { 'dense-analysis/ale', event = 'InsertEnter' },
|
||||
|
||||
-- Pretty start screen (alpha)
|
||||
-- {
|
||||
-- 'goolord/alpha-nvim',
|
||||
-- dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
-- config = function()
|
||||
-- require('alpha').setup(require('alpha.themes.startify').opts)
|
||||
-- end,
|
||||
-- },
|
||||
|
||||
-- nvim-lint
|
||||
-- {
|
||||
-- 'mfussenegger/nvim-lint',
|
||||
-- event = { 'BufReadPost', 'BufNewFile' },
|
||||
-- config = function()
|
||||
-- require('lint').linters_by_ft = {
|
||||
-- tex = { 'proselint', 'vale' },
|
||||
-- text = { 'proselint', 'vale' },
|
||||
-- }
|
||||
-- end,
|
||||
-- },
|
||||
|
||||
-- Colorscheme (load early)
|
||||
{
|
||||
'lifepillar/vim-gruvbox8',
|
||||
commit = '75614aff9669abd7f8b0aae58fdfbaddfebee1e0',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
init = function()
|
||||
vim.g.gruvbox_contrast_dark = 'hard'
|
||||
end,
|
||||
config = function()
|
||||
vim.cmd([[colorscheme gruvbox8_hard]])
|
||||
end,
|
||||
},
|
||||
|
||||
-- Surround
|
||||
{
|
||||
'ur4ltz/surround.nvim',
|
||||
config = function()
|
||||
require('surround').setup({
|
||||
context_offset = 100,
|
||||
load_autogroups = false,
|
||||
mappings_style = 'sandwich',
|
||||
map_insert_mode = true,
|
||||
quotes = { "'", '"' },
|
||||
brackets = { '{', '[' },
|
||||
space_on_closing_char = false,
|
||||
pairs = {
|
||||
nestable = { b = { '(', ')' }, s = { '[', ']' }, B = { '{', '}' }, a = { '<', '>' } },
|
||||
linear = { q = { "'", "'" }, t = { '`', '`' }, d = { '"', '"' } },
|
||||
},
|
||||
prefix = 's',
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- Toggleterm
|
||||
{
|
||||
'akinsho/toggleterm.nvim',
|
||||
version = '*',
|
||||
config = function()
|
||||
require('toggleterm').setup({
|
||||
insert_mapping = false,
|
||||
open_mapping = [[<leader>term]],
|
||||
autochdir = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
33
lazy-lock.json
Normal file
33
lazy-lock.json
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
{
|
||||
"LuaSnip": { "branch": "master", "commit": "b3104910bb5ebf40492aadffae18f2528fa757d9" },
|
||||
"auto-session": { "branch": "main", "commit": "292492ab7af4bd8b9e37e28508bc8ce995722fd5" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "655133c3b4c3e5e05ec549b9f8cc2894ac6f51b3" },
|
||||
"cmp-buffer": { "branch": "main", "commit": "b74fab3656eea9de20a9b8116afa3cfc4ec09657" },
|
||||
"cmp-cmdline": { "branch": "main", "commit": "d126061b624e0af6c3a556428712dd4d4194ec6d" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "bd5a7d6db125d4654b50eeae9f5217f24bb22fd3" },
|
||||
"cmp-path": { "branch": "main", "commit": "c642487086dbd9a93160e1679a1327be111cbc25" },
|
||||
"cmp_luasnip": { "branch": "master", "commit": "98d9cb5c2c38532bd9bdb481067b20fea8f32e90" },
|
||||
"friendly-snippets": { "branch": "main", "commit": "572f5660cf05f8cd8834e096d7b4c921ba18e175" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "85c7ff3711b730b4030d03144f6db6375044ae82" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "d7b5feb6e769e995f7fcf44d92f49f811c51d10c" },
|
||||
"mason.nvim": { "branch": "main", "commit": "ad7146aa61dcaeb54fa900144d768f040090bff0" },
|
||||
"noice.nvim": { "branch": "main", "commit": "7bfd942445fb63089b59f97ca487d605e715f155" },
|
||||
"nui.nvim": { "branch": "main", "commit": "de740991c12411b663994b2860f1a4fd0937c130" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "106c4bcc053a5da783bf4a9d907b6f22485c2ea0" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "2010fc6ec03e2da552b4886fceb2f7bc0fc2e9c0" },
|
||||
"nvim-notify": { "branch": "master", "commit": "8701bece920b38ea289b457f902e2ad184131a5d" },
|
||||
"nvim-surround": { "branch": "main", "commit": "fcfa7e02323d57bfacc3a141f8a74498e1522064" },
|
||||
"nvim-tree.lua": { "branch": "master", "commit": "64e2192f5250796aa4a7f33c6ad888515af50640" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" },
|
||||
"org-bullets.nvim": { "branch": "main", "commit": "21437cfa99c70f2c18977bffd423f912a7b832ea" },
|
||||
"orgmode": { "branch": "master", "commit": "b7bcb90ef446a3e846ac7e0a84391fd737e9b793" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "b9fd5226c2f76c951fc8ed5923d85e4de065e509" },
|
||||
"telescope.nvim": { "branch": "master", "commit": "c41b36d646c9d78fae9f1d64e0e86cdeeeb8a066" },
|
||||
"toggleterm.nvim": { "branch": "main", "commit": "50ea089fc548917cc3cc16b46a8211833b9e3c7c" },
|
||||
"trouble.nvim": { "branch": "main", "commit": "bd67efe408d4816e25e8491cc5ad4088e708a69a" },
|
||||
"vim-auto-save": { "branch": "master", "commit": "2e3e54ea4c0fc946c21b0a4ee4c1c295ba736ee8" },
|
||||
"vim-gruvbox8": { "branch": "master", "commit": "75614aff9669abd7f8b0aae58fdfbaddfebee1e0" },
|
||||
"vim-startify": { "branch": "master", "commit": "4e089dffdad46f3f5593f34362d530e8fe823dcf" },
|
||||
"vimtex": { "branch": "master", "commit": "be9deac3a23eeb145ccf11dd09080795838496ce" }
|
||||
}
|
||||
29
lua/keymaps/lsp.lua
Normal file
29
lua/keymaps/lsp.lua
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
-- lua/keymaps/lsp.lua
|
||||
local M = {}
|
||||
|
||||
function M.on_attach(_, bufnr)
|
||||
local set = vim.keymap.set
|
||||
local opts = { buffer = bufnr, noremap = true, silent = true }
|
||||
|
||||
set('n', 'gD', vim.lsp.buf.declaration, { desc = "LSP: Go to declaration", unpack(opts) })
|
||||
set('n', 'gd', vim.lsp.buf.definition, { desc = "LSP: Go to definition", unpack(opts) })
|
||||
set('n', 'K', vim.lsp.buf.hover, { desc = "LSP: Hover doc", unpack(opts) })
|
||||
set('n', 'gi', vim.lsp.buf.implementation, { desc = "LSP: Go to implementation", unpack(opts) })
|
||||
set('n', '<C-k>', vim.lsp.buf.signature_help, { desc = "LSP: Signature help", unpack(opts) })
|
||||
set('n', '<leader>wa', vim.lsp.buf.add_workspace_folder, { desc = "LSP: Add workspace folder", unpack(opts) })
|
||||
set('n', '<leader>wr', vim.lsp.buf.remove_workspace_folder, { desc = "LSP: Remove workspace folder", unpack(opts) })
|
||||
set('n', '<leader>wl', function() print(vim.inspect(vim.lsp.buf.list_workspace_folders())) end,
|
||||
{ desc = "LSP: List workspace folders", unpack(opts) })
|
||||
set('n', '<leader>D', vim.lsp.buf.type_definition, { desc = "LSP: Type definition", unpack(opts) })
|
||||
set('n', '<leader>rn', vim.lsp.buf.rename, { desc = "LSP: Rename", unpack(opts) })
|
||||
set({ 'n', 'v' }, '<leader>ca', vim.lsp.buf.code_action, { desc = "LSP: Code action", unpack(opts) })
|
||||
set('n', 'gr', vim.lsp.buf.references, { desc = "LSP: References", unpack(opts) })
|
||||
set('n', '[d', vim.diagnostic.goto_prev, { desc = "Prev diagnostic", unpack(opts) })
|
||||
set('n', ']d', vim.diagnostic.goto_next, { desc = "Next diagnostic", unpack(opts) })
|
||||
set('n', '<leader>q', vim.diagnostic.setloclist, { desc = "Diagnostic loclist", unpack(opts) })
|
||||
set('n', '<leader>e', vim.diagnostic.open_float, { desc = "Diagnostic float", unpack(opts) })
|
||||
set('n', '<leader>f', function() vim.lsp.buf.format { async = true } end, { desc = "LSP: Format", unpack(opts) })
|
||||
end
|
||||
|
||||
return M
|
||||
|
||||
1
lua/plugins/auto_save.lua
Normal file
1
lua/plugins/auto_save.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
return { '907th/vim-auto-save' }
|
||||
13
lua/plugins/auto_session.lua
Normal file
13
lua/plugins/auto_session.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
return {
|
||||
"rmagatti/auto-session",
|
||||
lazy = false,
|
||||
|
||||
---enables autocomplete for opts
|
||||
---@module "auto-session"
|
||||
---@type AutoSession.Config
|
||||
session_dir = vim.fn.stdpath('data') .. '/sessions',
|
||||
opts = {
|
||||
suppressed_dirs = { "~/", "~/Projects", "~/Downloads", "/" },
|
||||
-- log_level = 'debug',
|
||||
},
|
||||
}
|
||||
16
lua/plugins/bufferline.lua
Normal file
16
lua/plugins/bufferline.lua
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
return {
|
||||
'akinsho/bufferline.nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require('bufferline').setup({
|
||||
options = {
|
||||
always_show_bufferline = true,
|
||||
separator_style = 'thin',
|
||||
show_close_icon = false,
|
||||
numbers = 'buffer_id',
|
||||
enforce_regular_tabs = true,
|
||||
offsets = { { filetype = 'NvimTree', text = 'File Explorer', highlight = 'Directory' } },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
57
lua/plugins/cmp.lua
Normal file
57
lua/plugins/cmp.lua
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
return {
|
||||
"hrsh7th/nvim-cmp",
|
||||
dependencies = {
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"L3MON4D3/LuaSnip",
|
||||
"saadparwaiz1/cmp_luasnip",
|
||||
"rafamadriz/friendly-snippets",
|
||||
},
|
||||
config = function()
|
||||
local cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
luasnip.lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = true }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
elseif luasnip.expand_or_jumpable() then
|
||||
luasnip.expand_or_jump()
|
||||
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" }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "buffer" },
|
||||
{ name = "path" },
|
||||
}),
|
||||
})
|
||||
end,
|
||||
}
|
||||
|
||||
1
lua/plugins/devicons.lua
Normal file
1
lua/plugins/devicons.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
return { 'nvim-tree/nvim-web-devicons', lazy = true }
|
||||
12
lua/plugins/gruvbox.lua
Normal file
12
lua/plugins/gruvbox.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'lifepillar/vim-gruvbox8',
|
||||
commit = '75614aff9669abd7f8b0aae58fdfbaddfebee1e0',
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
init = function()
|
||||
vim.g.gruvbox_contrast_dark = 'hard'
|
||||
end,
|
||||
config = function()
|
||||
vim.cmd([[colorscheme gruvbox8_hard]])
|
||||
end,
|
||||
}
|
||||
41
lua/plugins/lspconfig.lua
Normal file
41
lua/plugins/lspconfig.lua
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
local lsp_keymaps = require("keymaps.lsp") -- or adjust path as needed
|
||||
local cmp_nvim_lsp = require("cmp_nvim_lsp")
|
||||
local capabilities = cmp_nvim_lsp.default_capabilities()
|
||||
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
dependencies = {
|
||||
'williamboman/mason.nvim',
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
},
|
||||
config = function()
|
||||
require("mason-lspconfig").setup({
|
||||
ensure_installed = { "lua_ls", "pyright", "bashls", "jsonls", "html", "cssls", "ts_ls", "ltex" }, -- note tsserver!
|
||||
automatic_installation = true,
|
||||
handlers = {
|
||||
-- Default handler for all servers
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp_keymaps.on_attach,
|
||||
})
|
||||
end,
|
||||
-- Custom config for ltex
|
||||
["ltex"] = function()
|
||||
require("lspconfig").ltex.setup({
|
||||
capabilities = capabilities,
|
||||
on_attach = lsp_keymaps.on_attach,
|
||||
filetypes = { "markdown", "text", "tex", "org" },
|
||||
settings = {
|
||||
ltex = {
|
||||
language = "en-US",
|
||||
server = { "https://lgtool.priyatham.in/v2" },
|
||||
suggestionsEnabled = true,
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
9
lua/plugins/luasnip.lua
Normal file
9
lua/plugins/luasnip.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
"L3MON4D3/LuaSnip",
|
||||
dependencies = { "rafamadriz/friendly-snippets" },
|
||||
build = "make install_jsregexp",
|
||||
config = function()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
}
|
||||
|
||||
8
lua/plugins/mason.lua
Normal file
8
lua/plugins/mason.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
'williamboman/mason.nvim',
|
||||
build = ":MasonUpdate",
|
||||
config = function()
|
||||
require("mason").setup()
|
||||
end,
|
||||
}
|
||||
|
||||
8
lua/plugins/mason_lspconfig.lua
Normal file
8
lua/plugins/mason_lspconfig.lua
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
return {
|
||||
'williamboman/mason-lspconfig.nvim',
|
||||
dependencies = { 'williamboman/mason.nvim' },
|
||||
config = function()
|
||||
require('mason-lspconfig').setup()
|
||||
end,
|
||||
}
|
||||
|
||||
28
lua/plugins/noice.lua
Normal file
28
lua/plugins/noice.lua
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
return {
|
||||
"folke/noice.nvim",
|
||||
event = "VeryLazy",
|
||||
opts = {
|
||||
-- your Noice options here!
|
||||
-- e.g.:
|
||||
lsp = {
|
||||
progress = { enabled = true },
|
||||
override = {
|
||||
["vim.lsp.util.convert_input_to_markdown_lines"] = true,
|
||||
["vim.lsp.util.stylize_markdown"] = true,
|
||||
["cmp.entry.get_documentation"] = true,
|
||||
},
|
||||
},
|
||||
views = {
|
||||
notify = {
|
||||
enter = false,
|
||||
timeout = 1500,
|
||||
}
|
||||
}
|
||||
},
|
||||
dependencies = {
|
||||
"MunifTanjim/nui.nvim",
|
||||
"rcarriga/nvim-notify",
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
7
lua/plugins/nvim_tree.lua
Normal file
7
lua/plugins/nvim_tree.lua
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
return {
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
config = function()
|
||||
require('nvim-tree').setup({})
|
||||
end,
|
||||
}
|
||||
12
lua/plugins/org_bullets.lua
Normal file
12
lua/plugins/org_bullets.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'akinsho/org-bullets.nvim',
|
||||
config = function()
|
||||
require('org-bullets').setup({
|
||||
checkboxes = {
|
||||
half = { '', 'OrgTSCheckboxHalfChecked' },
|
||||
done = { '✓', 'OrgDone' },
|
||||
todo = { 'x', 'OrgTODO' },
|
||||
},
|
||||
})
|
||||
end,
|
||||
}
|
||||
23
lua/plugins/orgmode.lua
Normal file
23
lua/plugins/orgmode.lua
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
return {
|
||||
'nvim-orgmode/orgmode',
|
||||
config = function()
|
||||
require('orgmode').setup({
|
||||
org_todo_keywords = { 'TODO', 'STARTED', 'STUCK', '|', 'DONE' },
|
||||
win_split_mode = 'vertical',
|
||||
org_todo_keyword_faces = {
|
||||
TODO = ':foreground red :weight bold',
|
||||
STARTED = ':foreground blue :weight bold',
|
||||
STUCK = ':foreground orange :weight bold',
|
||||
DONE = ':foreground green :weight bold',
|
||||
},
|
||||
org_agenda_files = { '~/org/*.org' },
|
||||
org_capture_templates = {
|
||||
s = { description = 'scheduled', template = '* TODO %? \n SCHEDULED: %T', target = '~/org/inbox.org' },
|
||||
t = { description = 'Task with time', template = '* TODO %^{prompt|default|} \n %t', target = '~/org/inbox.org' },
|
||||
d = { description = 'deadline', template = '* TODO %? \n DEADLINE: %T', target = '~/org/inbox.org' },
|
||||
r = { description = 'reply to', template = '* TODO reply to %? \n SCHEDULED: %T', target = '~/org/inbox.org' },
|
||||
},
|
||||
notifications = { enabled = true, reminder_time = { 1, 5, 10 } },
|
||||
})
|
||||
end,
|
||||
}
|
||||
1
lua/plugins/startify.lua
Normal file
1
lua/plugins/startify.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
return { 'mhinz/vim-startify' }
|
||||
9
lua/plugins/surround.lua
Normal file
9
lua/plugins/surround.lua
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
return {
|
||||
'kylechui/nvim-surround',
|
||||
version = "*",
|
||||
event = "VeryLazy",
|
||||
config = function()
|
||||
require("nvim-surround").setup({})
|
||||
end,
|
||||
}
|
||||
|
||||
4
lua/plugins/telescope.lua
Normal file
4
lua/plugins/telescope.lua
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
}
|
||||
11
lua/plugins/toggleterm.lua
Normal file
11
lua/plugins/toggleterm.lua
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
return {
|
||||
'akinsho/toggleterm.nvim',
|
||||
version = '*',
|
||||
config = function()
|
||||
require('toggleterm').setup({
|
||||
insert_mapping = false,
|
||||
open_mapping = [[<leader>term]],
|
||||
autochdir = true,
|
||||
})
|
||||
end,
|
||||
}
|
||||
12
lua/plugins/treesitter.lua
Normal file
12
lua/plugins/treesitter.lua
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = ':TSUpdate',
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup({
|
||||
ensure_installed = { "html", "markdown", "markdown_inline", "json", "yaml", "lua", "python",
|
||||
"css", "javascript", "typescript", "bash", "vim", "go", "toml", "xml"}, -- add languages you use
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end,
|
||||
}
|
||||
21
lua/plugins/trouble.lua
Normal file
21
lua/plugins/trouble.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
return {
|
||||
"folke/trouble.nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
opts = {
|
||||
|
||||
icons = true,
|
||||
fold_open = "",
|
||||
fold_closed = "",
|
||||
group = true,
|
||||
padding = false,
|
||||
signs = {
|
||||
-- Customize diagnostic icons
|
||||
error = "",
|
||||
warning = "",
|
||||
hint = "",
|
||||
information = "",
|
||||
other = ""
|
||||
},
|
||||
use_diagnostic_signs = true, -- Use signs defined by your lsp/cmp setup
|
||||
}, -- use default settings
|
||||
}
|
||||
1
lua/plugins/vimtex.lua
Normal file
1
lua/plugins/vimtex.lua
Normal file
|
|
@ -0,0 +1 @@
|
|||
return { 'lervag/vimtex' }
|
||||
2
orgagenda
Normal file
2
orgagenda
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
|
||||
"
|
||||
Loading…
Reference in a new issue