updates
This commit is contained in:
parent
bc5f8b84fc
commit
1951664755
10
init.lua
10
init.lua
@ -11,8 +11,8 @@ if not vim.loop.fs_stat(lazypath) then
|
||||
end
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require('options')
|
||||
require('lazy').setup('plugins')
|
||||
require('mappings')
|
||||
require('lsp_settings')
|
||||
require('autocmds')
|
||||
require("options")
|
||||
require("lazy").setup("plugins")
|
||||
require("mappings")
|
||||
require("lsp_settings")
|
||||
require("autocmds")
|
||||
|
@ -54,22 +54,29 @@ autocmd("CursorMoved", {
|
||||
group = _group,
|
||||
})
|
||||
|
||||
local nvim_tree_events = require('nvim-tree.events')
|
||||
local bufferline_api = require('bufferline.api')
|
||||
vim.cmd([[
|
||||
:augroup fmt
|
||||
: autocmd!
|
||||
: autocmd BufWritePre * silent! undojoin | silent! Neoformat
|
||||
:augroup END
|
||||
]])
|
||||
|
||||
local nvim_tree_events = require("nvim-tree.events")
|
||||
local bufferline_api = require("bufferline.api")
|
||||
|
||||
local function get_tree_size()
|
||||
return require 'nvim-tree.view'.View.width
|
||||
return require("nvim-tree.view").View.width
|
||||
end
|
||||
|
||||
nvim_tree_events.subscribe('TreeOpen', function()
|
||||
nvim_tree_events.subscribe("TreeOpen", function()
|
||||
bufferline_api.set_offset(get_tree_size())
|
||||
end)
|
||||
|
||||
nvim_tree_events.subscribe('Resize', function()
|
||||
nvim_tree_events.subscribe("Resize", function()
|
||||
bufferline_api.set_offset(get_tree_size())
|
||||
end)
|
||||
|
||||
nvim_tree_events.subscribe('TreeClose', function()
|
||||
nvim_tree_events.subscribe("TreeClose", function()
|
||||
bufferline_api.set_offset(0)
|
||||
end)
|
||||
|
||||
@ -109,34 +116,32 @@ autocmd("BufEnter", {
|
||||
})
|
||||
|
||||
-- auto close nvimtree
|
||||
autocmd('BufEnter', {
|
||||
autocmd("BufEnter", {
|
||||
command = "if winnr('$') == 1 && bufname() == 'NvimTree_' . tabpagenr() | quit | endif",
|
||||
nested = true,
|
||||
})
|
||||
|
||||
|
||||
-- dont show line numbers for nvimtree buffers
|
||||
autocmd("BufEnter",
|
||||
{
|
||||
autocmd("BufEnter", {
|
||||
pattern = { "NvimTree*" },
|
||||
callback = function()
|
||||
vim.b.lnstatus = "nonumber"
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Disable the statusline, tabline and cmdline while the alpha dashboard is open
|
||||
autocmd('User', {
|
||||
pattern = 'AlphaReady',
|
||||
desc = 'disable status, tabline and cmdline for alpha',
|
||||
autocmd("User", {
|
||||
pattern = "AlphaReady",
|
||||
desc = "disable status, tabline and cmdline for alpha",
|
||||
callback = function()
|
||||
vim.go.laststatus = 1
|
||||
vim.opt.showtabline = 1
|
||||
vim.opt.cmdheight = 1
|
||||
end,
|
||||
})
|
||||
autocmd('BufUnload', {
|
||||
autocmd("BufUnload", {
|
||||
buffer = 0,
|
||||
desc = 'enable status, tabline and cmdline after alpha',
|
||||
desc = "enable status, tabline and cmdline after alpha",
|
||||
callback = function()
|
||||
vim.go.laststatus = 2
|
||||
vim.opt.showtabline = 2
|
||||
|
@ -1,17 +1,17 @@
|
||||
require("mason").setup {
|
||||
automatic_installation = true
|
||||
}
|
||||
require("mason").setup({
|
||||
automatic_installation = true,
|
||||
})
|
||||
|
||||
-- Setup lspconfig.
|
||||
local capabilities = require('cmp_nvim_lsp').default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
local capabilities = require("cmp_nvim_lsp").default_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
local navic = require("nvim-navic")
|
||||
|
||||
-- LSP hotkey config
|
||||
local opts = { noremap = true, silent = true }
|
||||
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set('n', ']d', vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)
|
||||
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float, opts)
|
||||
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev, opts)
|
||||
vim.keymap.set("n", "]d", vim.diagnostic.goto_next, opts)
|
||||
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist, opts)
|
||||
|
||||
-- Use an on_attach function to only map the following keys
|
||||
-- after the language server attaches to the current buffer
|
||||
@ -19,28 +19,28 @@ local on_attach = function(client, bufnr)
|
||||
if client.server_capabilities.documentSymbolProvider then
|
||||
navic.attach(client, bufnr)
|
||||
end
|
||||
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
|
||||
-- vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
|
||||
-- Enable completion triggered by <c-x><c-o>
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
vim.api.nvim_buf_set_option(bufnr, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set('n', '<space>wl', function()
|
||||
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, bufopts)
|
||||
vim.keymap.set("n", "gd", vim.lsp.buf.definition, bufopts)
|
||||
vim.keymap.set("n", "K", vim.lsp.buf.hover, bufopts)
|
||||
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, bufopts)
|
||||
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, bufopts)
|
||||
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, bufopts)
|
||||
vim.keymap.set("n", "<space>wl", function()
|
||||
print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
|
||||
end, bufopts)
|
||||
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<space>f', vim.lsp.buf.formatting, bufopts)
|
||||
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, bufopts)
|
||||
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set("n", "<space>ca", vim.lsp.buf.code_action, bufopts)
|
||||
vim.keymap.set("n", "gr", vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set("n", "<space>f", vim.lsp.buf.formatting, bufopts)
|
||||
end
|
||||
|
||||
local lsp_flags = {
|
||||
@ -49,25 +49,25 @@ local lsp_flags = {
|
||||
}
|
||||
|
||||
--- initialize language servers
|
||||
require('mason-lspconfig').setup()
|
||||
require('mason-lspconfig').setup_handlers {
|
||||
require("mason-lspconfig").setup()
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function(server_name)
|
||||
require("lspconfig")[server_name].setup {
|
||||
require("lspconfig")[server_name].setup({
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
settings = {
|
||||
Lua = {
|
||||
completion = {
|
||||
callSnippet = 'Replace',
|
||||
callSnippet = "Replace",
|
||||
},
|
||||
diagnostics = {
|
||||
globals = { 'vim' }
|
||||
}
|
||||
globals = { "vim" },
|
||||
},
|
||||
}
|
||||
}
|
||||
require("lspconfig")['tsserver'].setup {
|
||||
},
|
||||
},
|
||||
})
|
||||
require("lspconfig")["tsserver"].setup({
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
@ -76,12 +76,12 @@ require('mason-lspconfig').setup_handlers {
|
||||
format = {
|
||||
insertSpaceAfterOpeningAndBeforeClosingEmptyBraces = false,
|
||||
insertSpaceAfterFunctionKeywordForAnonymousFunctions = true,
|
||||
semicolons = 'remove',
|
||||
semicolons = "remove",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
require("lspconfig")['pylsp'].setup {
|
||||
})
|
||||
require("lspconfig")["pylsp"].setup({
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
@ -89,13 +89,13 @@ require('mason-lspconfig').setup_handlers {
|
||||
pylsp = {
|
||||
plugins = {
|
||||
pycodestyle = {
|
||||
maxLineLength = 120
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
require("lspconfig")['gopls'].setup {
|
||||
maxLineLength = 120,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
})
|
||||
require("lspconfig")["gopls"].setup({
|
||||
on_attach = on_attach,
|
||||
flags = lsp_flags,
|
||||
capabilities = capabilities,
|
||||
@ -109,8 +109,8 @@ require('mason-lspconfig').setup_handlers {
|
||||
unusedvariable = true,
|
||||
},
|
||||
staticcheck = true,
|
||||
}
|
||||
},
|
||||
}
|
||||
end
|
||||
}
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
||||
|
@ -1,4 +1,4 @@
|
||||
local vimp = require('vimp')
|
||||
local vimp = require("vimp")
|
||||
|
||||
-- tabs and stuff
|
||||
vimp.vnoremap("<C-b>", [[<C-a>]])
|
||||
@ -13,7 +13,7 @@ vimp.xnoremap("<", [[<gv]])
|
||||
vimp.xnoremap(">", [[>gv]])
|
||||
|
||||
-- Toggle Lines
|
||||
vimp.nnoremap({ 'silent' }, '<leader>l', function()
|
||||
vimp.nnoremap({ "silent" }, "<leader>l", function()
|
||||
if vim.b.lnstatus == nil then
|
||||
vim.b.lnstatus = "number"
|
||||
end
|
||||
@ -29,18 +29,18 @@ vimp.nnoremap({ 'silent' }, '<leader>l', function()
|
||||
end)
|
||||
|
||||
-- plugins
|
||||
vimp.noremap('<leader>md', [[:MarkdownPreviewToggle<CR>]])
|
||||
vimp.noremap("<leader>md", [[:MarkdownPreviewToggle<CR>]])
|
||||
|
||||
vimp.nnoremap({ 'silent' }, '<A-Right>', [[:BufferNext<CR>]])
|
||||
vimp.nnoremap({ 'silent' }, '<A-Left>', [[:BufferPrevious<CR>]])
|
||||
vimp.nnoremap({ "silent" }, "<A-Right>", [[:BufferNext<CR>]])
|
||||
vimp.nnoremap({ "silent" }, "<A-Left>", [[:BufferPrevious<CR>]])
|
||||
|
||||
vimp.nnoremap({ "silent" }, "<leader>a", [[:ArgWrap<CR>]])
|
||||
|
||||
vimp.nnoremap({ 'silent' }, '<leader>a', [[:ArgWrap<CR>]])
|
||||
vimp.noremap({ "silent" }, "<leader>n", [[:NvimTreeToggle<CR>]])
|
||||
|
||||
|
||||
vimp.noremap({ 'silent' }, '<leader>n', [[:NvimTreeToggle<CR>]])
|
||||
|
||||
vimp.noremap({ 'silent' }, '<leader>ff', [[:Telescope find_files<CR>]])
|
||||
vimp.noremap({ 'silent' }, '<leader>fg', [[:Telescope live_grep<CR>]])
|
||||
vimp.noremap({ 'silent' }, '<leader>fb', [[:Telescope buffers<CR>]])
|
||||
vimp.noremap({ 'silent' }, '<leader>fp', function() require 'telescope'.extensions.projects.projects {} end)
|
||||
vimp.noremap({ "silent" }, "<leader>ff", [[:Telescope find_files<CR>]])
|
||||
vimp.noremap({ "silent" }, "<leader>fg", [[:Telescope live_grep<CR>]])
|
||||
vimp.noremap({ "silent" }, "<leader>fb", [[:Telescope buffers<CR>]])
|
||||
vimp.noremap({ "silent" }, "<leader>fp", function()
|
||||
require("telescope").extensions.projects.projects({})
|
||||
end)
|
||||
|
@ -13,11 +13,11 @@ vim.o.mmp = 5000
|
||||
|
||||
-- don't give |ins-completion-menu| messages.
|
||||
vim.o.hidden = true
|
||||
vim.o.signcolumn = 'yes'
|
||||
vim.o.encoding = 'utf-8'
|
||||
vim.o.shortmess = 'c'
|
||||
vim.o.signcolumn = "yes"
|
||||
vim.o.encoding = "utf-8"
|
||||
vim.o.shortmess = "c"
|
||||
vim.o.autoread = true
|
||||
vim.o.backspace = 'indent,eol,start'
|
||||
vim.o.backspace = "indent,eol,start"
|
||||
vim.o.ruler = true
|
||||
vim.o.showmode = true
|
||||
vim.o.history = 1000
|
||||
@ -35,24 +35,24 @@ vim.o.softtabstop = 2
|
||||
vim.o.tabstop = 2
|
||||
vim.o.expandtab = true
|
||||
vim.o.scrolloff = 5
|
||||
vim.o.foldmethod = 'indent'
|
||||
vim.o.foldmethod = "indent"
|
||||
vim.o.foldlevel = 99
|
||||
vim.wo.wrap = false
|
||||
vim.o.showcmd = true
|
||||
vim.o.number = true
|
||||
vim.o.relativenumber = true
|
||||
vim.o.mouse = 'a'
|
||||
vim.o.mouse = "a"
|
||||
vim.o.redrawtime = 10000
|
||||
vim.o.inccommand = 'split'
|
||||
vim.o.inccommand = "split"
|
||||
---- Sync " and + registers
|
||||
vim.o.clipboard = 'unnamedplus'
|
||||
vim.o.clipboard = "unnamedplus"
|
||||
|
||||
-- show completion options on <TAB>
|
||||
vim.o.wildmenu = true
|
||||
-- complete only up to the point of ambiguity
|
||||
vim.o.wildmode = 'list:longest'
|
||||
vim.o.wildmode = "list:longest"
|
||||
|
||||
vim.opt.backupdir = os.getenv("XDG_CACHE_HOME") .. '/nvim/backup//'
|
||||
vim.o.directory = os.getenv("XDG_CACHE_HOME") .. '/nvim/swap//'
|
||||
vim.o.undodir = os.getenv("XDG_CACHE_HOME") .. '/nvim/undo//'
|
||||
vim.opt.backupdir = os.getenv("XDG_CACHE_HOME") .. "/nvim/backup//"
|
||||
vim.o.directory = os.getenv("XDG_CACHE_HOME") .. "/nvim/swap//"
|
||||
vim.o.undodir = os.getenv("XDG_CACHE_HOME") .. "/nvim/undo//"
|
||||
vim.o.undofile = true
|
||||
|
283
lua/plugins.lua
283
lua/plugins.lua
@ -1,16 +1,16 @@
|
||||
return {
|
||||
|
||||
-- https://github.com/tpope/vim-obsession
|
||||
'tpope/vim-obsession',
|
||||
"tpope/vim-obsession",
|
||||
|
||||
-- https://github.com/svermeulen/vimpeccable
|
||||
'svermeulen/vimpeccable',
|
||||
"svermeulen/vimpeccable",
|
||||
|
||||
-- https://github.com/kien/ctrlp.vim
|
||||
'ctrlpvim/ctrlp.vim',
|
||||
"ctrlpvim/ctrlp.vim",
|
||||
|
||||
-- https://github.com/lervag/vimtex#installation
|
||||
'lervag/vimtex',
|
||||
"lervag/vimtex",
|
||||
|
||||
-- https://github.com/iamcco/markdown-preview.nvim
|
||||
{
|
||||
@ -20,46 +20,25 @@ return {
|
||||
end,
|
||||
config = function()
|
||||
vim.g.mkdp_filetypes = { "markdown" }
|
||||
vim.g.mkdp_markdown_css = os.getenv("XDG_CONFIG_HOME") .. '/nvim/static/custom.css'
|
||||
vim.g.mkdp_highlight_css = os.getenv("XDG_CACHE_HOME") .. '/wal/colors.css'
|
||||
vim.g.mkdp_browser = 'rose'
|
||||
vim.g.mkdp_markdown_css = os.getenv("XDG_CONFIG_HOME") .. "/nvim/static/custom.css"
|
||||
vim.g.mkdp_highlight_css = os.getenv("XDG_CACHE_HOME") .. "/wal/colors.css"
|
||||
vim.g.mkdp_browser = "rose"
|
||||
vim.g.mkdp_echo_preview_url = 1
|
||||
end,
|
||||
ft = { "markdown" }
|
||||
ft = { "markdown" },
|
||||
},
|
||||
|
||||
{
|
||||
'windwp/nvim-spectre',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||
"windwp/nvim-spectre",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
|
||||
{
|
||||
'MunifTanjim/prettier.nvim',
|
||||
config = function()
|
||||
local prettier = require("prettier")
|
||||
|
||||
prettier.setup({
|
||||
bin = 'prettierd', -- or `'prettierd'` (v0.23.3+)
|
||||
filetypes = {
|
||||
"css",
|
||||
"graphql",
|
||||
"html",
|
||||
"javascript",
|
||||
"javascriptreact",
|
||||
"json",
|
||||
"less",
|
||||
"markdown",
|
||||
"scss",
|
||||
"typescript",
|
||||
"typescriptreact",
|
||||
"yaml",
|
||||
},
|
||||
})
|
||||
end
|
||||
"sbdchd/neoformat",
|
||||
},
|
||||
|
||||
{
|
||||
'simrat39/rust-tools.nvim',
|
||||
"simrat39/rust-tools.nvim",
|
||||
config = function()
|
||||
local rt = require("rust-tools")
|
||||
rt.setup({
|
||||
@ -72,16 +51,16 @@ return {
|
||||
end,
|
||||
},
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
'ray-x/web-tools.nvim',
|
||||
"ray-x/web-tools.nvim",
|
||||
config = function()
|
||||
require 'web-tools'.setup({
|
||||
require("web-tools").setup({
|
||||
keymaps = {
|
||||
rename = nil, -- by default use same setup of lspconfig
|
||||
repeat_rename = '.', -- . to repeat
|
||||
repeat_rename = ".", -- . to repeat
|
||||
},
|
||||
hurl = {
|
||||
-- hurl default
|
||||
@ -89,17 +68,17 @@ return {
|
||||
floating = false, -- use floating windows (need guihua.lua)
|
||||
formatters = {
|
||||
-- format the result by filetype
|
||||
json = { 'jq' },
|
||||
html = { 'prettier', '--parser', 'html' },
|
||||
json = { "jq" },
|
||||
html = { "prettier", "--parser", "html" },
|
||||
},
|
||||
},
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/fatih/vim-go
|
||||
{
|
||||
'fatih/vim-go',
|
||||
"fatih/vim-go",
|
||||
config = function()
|
||||
vim.g.go_fmt_command = "gofumpt"
|
||||
vim.g.go_fmt_fail_silently = 1
|
||||
@ -110,85 +89,84 @@ return {
|
||||
vim.g.go_highlight_operators = 1
|
||||
vim.g.go_highlight_extra_types = 1
|
||||
vim.g.go_highlight_build_constraints = 1
|
||||
vim.g.go_metalinter_command = 'golangci-lint'
|
||||
end
|
||||
vim.g.go_metalinter_command = "golangci-lint"
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/norcalli/nvim-colorizer.lua
|
||||
{
|
||||
'norcalli/nvim-colorizer.lua',
|
||||
"norcalli/nvim-colorizer.lua",
|
||||
config = function()
|
||||
require('colorizer').setup()
|
||||
require("colorizer").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/numToStr/Comment.nvim
|
||||
{
|
||||
'numToStr/Comment.nvim',
|
||||
"numToStr/Comment.nvim",
|
||||
config = function()
|
||||
require('Comment').setup()
|
||||
end
|
||||
require("Comment").setup()
|
||||
end,
|
||||
},
|
||||
|
||||
{
|
||||
"ahmedkhalf/project.nvim",
|
||||
config = function()
|
||||
require("project_nvim").setup {}
|
||||
end
|
||||
require("project_nvim").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
|
||||
-- https://github.com/ellisonleao/glow.nvim
|
||||
{
|
||||
"ellisonleao/glow.nvim",
|
||||
cmd = "Glow",
|
||||
config = function()
|
||||
require('glow').setup({})
|
||||
require("glow").setup({})
|
||||
end,
|
||||
ft = { "markdown" }
|
||||
ft = { "markdown" },
|
||||
},
|
||||
|
||||
-- https://github.com/windwp/nvim-autopairs
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
"windwp/nvim-autopairs",
|
||||
config = function()
|
||||
require('nvim-autopairs').setup {}
|
||||
require("nvim-autopairs").setup({})
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/lewis6991/gitsigns.nvim
|
||||
{
|
||||
'lewis6991/gitsigns.nvim',
|
||||
"lewis6991/gitsigns.nvim",
|
||||
config = function()
|
||||
require('gitsigns').setup({
|
||||
require("gitsigns").setup({
|
||||
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
virt_text_pos = "eol", -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 100,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
yadm = {
|
||||
enable = true
|
||||
enable = true,
|
||||
},
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/nvim-telescope/telescope.nvim
|
||||
{
|
||||
'nvim-telescope/telescope.nvim',
|
||||
"nvim-telescope/telescope.nvim",
|
||||
cmd = "Telescope",
|
||||
branch = '0.1.x',
|
||||
branch = "0.1.x",
|
||||
dependencies = {
|
||||
{
|
||||
'nvim-lua/plenary.nvim',
|
||||
lazy = true
|
||||
"nvim-lua/plenary.nvim",
|
||||
lazy = true,
|
||||
},
|
||||
},
|
||||
config = function()
|
||||
require('telescope').load_extension('projects')
|
||||
end
|
||||
require("telescope").load_extension("projects")
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/SmiteshP/nvim-navic
|
||||
@ -196,7 +174,7 @@ return {
|
||||
"SmiteshP/nvim-navic",
|
||||
dependencies = "neovim/nvim-lspconfig",
|
||||
config = function()
|
||||
require('nvim-navic').setup({
|
||||
require("nvim-navic").setup({
|
||||
icons = {
|
||||
File = " ",
|
||||
Module = " ",
|
||||
@ -229,24 +207,24 @@ return {
|
||||
separator = " > ",
|
||||
depth_limit = 0,
|
||||
depth_limit_indicator = "..",
|
||||
safe_output = true
|
||||
safe_output = true,
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/nvim-tree/nvim-tree.lua
|
||||
{
|
||||
'nvim-tree/nvim-tree.lua',
|
||||
"nvim-tree/nvim-tree.lua",
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
},
|
||||
config = function()
|
||||
require('nvim-tree').setup {
|
||||
require("nvim-tree").setup({
|
||||
sync_root_with_cwd = true,
|
||||
respect_buf_cwd = true,
|
||||
update_focused_file = {
|
||||
enable = true,
|
||||
update_root = true
|
||||
update_root = true,
|
||||
},
|
||||
sort_by = "case_sensitive",
|
||||
view = {
|
||||
@ -261,8 +239,8 @@ return {
|
||||
live_filter = {
|
||||
always_show_folders = false,
|
||||
},
|
||||
}
|
||||
end
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/kylechui/nvim-surround
|
||||
@ -272,25 +250,25 @@ return {
|
||||
require("nvim-surround").setup({
|
||||
-- Configuration here, or leave empty to use defaults
|
||||
})
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/ethanholz/nvim-lastplace
|
||||
{
|
||||
'ethanholz/nvim-lastplace',
|
||||
"ethanholz/nvim-lastplace",
|
||||
config = function()
|
||||
require('nvim-lastplace').setup {
|
||||
lastplace_open_folds = true
|
||||
}
|
||||
end
|
||||
require("nvim-lastplace").setup({
|
||||
lastplace_open_folds = true,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/mg979/vim-visual-multi
|
||||
'mg979/vim-visual-multi',
|
||||
"mg979/vim-visual-multi",
|
||||
|
||||
-- https://github.com/FooSoft/vim-argwrap
|
||||
{
|
||||
'FooSoft/vim-argwrap',
|
||||
"FooSoft/vim-argwrap",
|
||||
},
|
||||
|
||||
-- https://github.com/kylechui/nvim-surround
|
||||
@ -298,17 +276,17 @@ return {
|
||||
"kylechui/nvim-surround",
|
||||
config = function()
|
||||
require("nvim-surround").setup()
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/neovim/nvim-lspconfig
|
||||
'neovim/nvim-lspconfig',
|
||||
"neovim/nvim-lspconfig",
|
||||
|
||||
-- https://github.com/williamboman/mason-lspconfig.nvim
|
||||
'williamboman/mason-lspconfig',
|
||||
"williamboman/mason-lspconfig",
|
||||
|
||||
-- https://github.com/williamboman/mason.nvim
|
||||
'williamboman/mason.nvim',
|
||||
"williamboman/mason.nvim",
|
||||
|
||||
-- https://github.com/hrsh7th/nvim-cmp
|
||||
{
|
||||
@ -325,17 +303,18 @@ return {
|
||||
{ "onsails/lspkind.nvim" },
|
||||
},
|
||||
config = function()
|
||||
local lspkind = require('lspkind')
|
||||
local lspkind = require("lspkind")
|
||||
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
|
||||
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 cmp = require("cmp")
|
||||
local luasnip = require("luasnip")
|
||||
cmp.setup({
|
||||
experimental = {
|
||||
ghost_text = true
|
||||
ghost_text = true,
|
||||
},
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
@ -344,24 +323,24 @@ return {
|
||||
},
|
||||
formatting = {
|
||||
format = lspkind.cmp_format({
|
||||
mode = 'symbol',
|
||||
mode = "symbol",
|
||||
maxwidth = 50,
|
||||
ellipsis_char = '...',
|
||||
ellipsis_char = "...",
|
||||
before = function(entry, vim_item)
|
||||
return vim_item
|
||||
end
|
||||
})
|
||||
end,
|
||||
}),
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = false }),
|
||||
["<C-b>"] = cmp.mapping.scroll_docs(-4),
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
["<C-e>"] = cmp.mapping.abort(),
|
||||
["<CR>"] = cmp.mapping.confirm({ select = false }),
|
||||
["<Tab>"] = cmp.mapping(function(fallback)
|
||||
if cmp.visible() then
|
||||
cmp.select_next_item()
|
||||
@ -386,118 +365,117 @@ return {
|
||||
end, { "i", "s" }),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'path' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'neorg' },
|
||||
{ name = "nvim_lsp" },
|
||||
{ name = "nvim_lua" },
|
||||
{ name = "path" },
|
||||
{ name = "luasnip" },
|
||||
{ name = "neorg" },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
})
|
||||
|
||||
cmp.setup.filetype('gitcommit', {
|
||||
cmp.setup.filetype("gitcommit", {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'cmp_git' },
|
||||
{ name = "cmp_git" },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
{ name = "buffer" },
|
||||
}),
|
||||
})
|
||||
|
||||
cmp.setup.cmdline('/', {
|
||||
cmp.setup.cmdline("/", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
{ name = "buffer" },
|
||||
},
|
||||
})
|
||||
|
||||
cmp.setup.cmdline(':', {
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
{ name = "path" },
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
{ name = "cmdline" },
|
||||
}),
|
||||
})
|
||||
})
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
require("luasnip.loaders.from_vscode").lazy_load()
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/AlphaTechnolog/pywal.nvim
|
||||
{
|
||||
'AlphaTechnolog/pywal.nvim',
|
||||
"AlphaTechnolog/pywal.nvim",
|
||||
priority = 1000,
|
||||
name = 'pywal',
|
||||
name = "pywal",
|
||||
config = function()
|
||||
local pywal = require('pywal')
|
||||
local pywal = require("pywal")
|
||||
pywal.setup()
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/nvim-lualine/lualine.nvim
|
||||
{
|
||||
'hoob3rt/lualine.nvim',
|
||||
dependencies = { { 'nvim-tree/nvim-web-devicons' } },
|
||||
"hoob3rt/lualine.nvim",
|
||||
dependencies = { { "nvim-tree/nvim-web-devicons" } },
|
||||
config = function()
|
||||
local navic = require("nvim-navic")
|
||||
require('lualine').setup({
|
||||
require("lualine").setup({
|
||||
sections = {
|
||||
lualine_c = {
|
||||
{ navic.get_location, cond = navic.is_available },
|
||||
}
|
||||
},
|
||||
},
|
||||
options = {
|
||||
theme = 'pywal-nvim'
|
||||
}
|
||||
theme = "pywal-nvim",
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/romgrk/barbar.nvim
|
||||
{
|
||||
'romgrk/barbar.nvim',
|
||||
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
"romgrk/barbar.nvim",
|
||||
dependencies = "nvim-tree/nvim-web-devicons",
|
||||
config = function()
|
||||
require 'bufferline'.setup {
|
||||
require("bufferline").setup({
|
||||
animation = true,
|
||||
closable = true,
|
||||
clickable = true,
|
||||
icons = {
|
||||
seperator = {
|
||||
left = ' ',
|
||||
left = " ",
|
||||
},
|
||||
incactive = {
|
||||
seperator = {
|
||||
left = ' ',
|
||||
left = " ",
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
end
|
||||
},
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/rktjmp/fwatch.nvim
|
||||
{
|
||||
'rktjmp/fwatch.nvim',
|
||||
"rktjmp/fwatch.nvim",
|
||||
config = function()
|
||||
require('fwatch').watch(os.getenv("XDG_CACHE_HOME") .. "/wal/colors",
|
||||
{
|
||||
require("fwatch").watch(os.getenv("XDG_CACHE_HOME") .. "/wal/colors", {
|
||||
on_event = function()
|
||||
vim.defer_fn(function()
|
||||
vim.cmd('colorscheme pywal')
|
||||
vim.cmd("colorscheme pywal")
|
||||
end, 100)
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
},
|
||||
|
||||
-- https://github.com/goolord/alpha-nvim
|
||||
{
|
||||
'goolord/alpha-nvim',
|
||||
dependencies = { 'nvim-tree/nvim-web-devicons' },
|
||||
"goolord/alpha-nvim",
|
||||
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||
config = function()
|
||||
local alpha = require('alpha')
|
||||
local dashboard = require('alpha.themes.dashboard')
|
||||
local alpha = require("alpha")
|
||||
local dashboard = require("alpha.themes.dashboard")
|
||||
dashboard.section.header.val = {
|
||||
[[ ▄▄▄ ▄▄▄▄ ██████ ███▄ █ ▄▄▄█████▓]],
|
||||
[[▒████▄ ▓█████▄ ▒██ ▒ ██ ▀█ █ ▓ ██▒ ▓▒]],
|
||||
@ -508,7 +486,7 @@ return {
|
||||
[[ ▒ ▒▒ ░▒░▒ ░ ░ ░▒ ░ ░░ ░░ ░ ▒░ ░ ]],
|
||||
[[ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ]],
|
||||
[[ ░ ░ ░ ░ ░ ]],
|
||||
[[ ░ ]]
|
||||
[[ ░ ]],
|
||||
}
|
||||
dashboard.section.buttons.val = {
|
||||
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
|
||||
@ -516,11 +494,14 @@ return {
|
||||
dashboard.button("p", " Find project", ":Telescope projects<CR>"),
|
||||
dashboard.button("f", " Find file", ":Telescope find_files<CR>"),
|
||||
dashboard.button("t", " Find text", ":Telescope live_grep <CR>"),
|
||||
dashboard.button("s", " Settings",
|
||||
":e $HOME/.config/nvim/init.lua | :cd %:p:h | split . | wincmd k | pwd<CR>"),
|
||||
dashboard.button(
|
||||
"s",
|
||||
" Settings",
|
||||
":e $HOME/.config/nvim/init.lua | :cd %:p:h | split . | wincmd k | pwd<CR>"
|
||||
),
|
||||
dashboard.button("q", " Quit NVIM", ":qa<CR>"),
|
||||
}
|
||||
dashboard.section.footer.val = require 'alpha.fortune'
|
||||
dashboard.section.footer.val = require("alpha.fortune")
|
||||
dashboard.section.header.opts.hl = "Title"
|
||||
dashboard.section.buttons.opts.hl = "Debug"
|
||||
dashboard.section.footer.opts.hl = "Conceal"
|
||||
@ -529,6 +510,6 @@ return {
|
||||
vim.b.lnstatus = "nonumber"
|
||||
end
|
||||
alpha.setup(dashboard.opts)
|
||||
end
|
||||
end,
|
||||
},
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user