This commit is contained in:
abs3nt 2023-03-02 15:26:30 -08:00
parent 663d447878
commit 945dcd804b
6 changed files with 556 additions and 143 deletions

View File

@ -1,5 +1,18 @@
require('plugins') 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)
require('mappings')
require("lazy").setup("plugins")
require('options') require('options')
require('lsp_settings') require('lsp_settings')
require('mappings')
require('autocmds') require('autocmds')

48
lazy-lock.json Normal file
View File

@ -0,0 +1,48 @@
{
"LuaSnip": { "branch": "master", "commit": "4baa7334e17d177841d66dbe71d51000ca55c144" },
"alpha-nvim": { "branch": "main", "commit": "b6c7b5d9d6d2633722255abf2be3ecb8733e8d2d" },
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
"cmp-calc": { "branch": "main", "commit": "50792f34a628ea6eb31d2c90e8df174671e4e7a0" },
"cmp-cmdline": { "branch": "main", "commit": "8fcc934a52af96120fe26358985c10c035984b53" },
"cmp-emoji": { "branch": "main", "commit": "19075c36d5820253d32e2478b6aaf3734aeaafa0" },
"cmp-nvim-lsp": { "branch": "main", "commit": "0e6b2ed705ddcff9738ec4ea838141654f12eeef" },
"cmp-nvim-lua": { "branch": "main", "commit": "f3491638d123cfd2c8048aefaf66d246ff250ca6" },
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
"cmp-spell": { "branch": "master", "commit": "60584cb75e5e8bba5a0c9e4c3ab0791e0698bffa" },
"cmp_luasnip": { "branch": "master", "commit": "18095520391186d634a0045dacaa346291096566" },
"ctrlp.vim": { "branch": "master", "commit": "8b4a9523632049b3b373de1233bef346073b8982" },
"document-color.nvim": { "branch": "main", "commit": "74c487f0e5accfaae033755451b9e367220693fd" },
"friendly-snippets": { "branch": "main", "commit": "a96bf8b1eedc1ed4f692df626318610947abced6" },
"fwatch.nvim": { "branch": "main", "commit": "a691f7349dc66285cd75a1a698dd28bca45f2bf8" },
"git-blame.nvim": { "branch": "master", "commit": "1ad47c6454a5a53d3f4ffdd4022e84f4a6e376cb" },
"gitsigns.nvim": { "branch": "main", "commit": "3b6c0a6412b31b91eb26bb8f712562cf7bb1d3be" },
"glow.nvim": { "branch": "main", "commit": "2bb4afb6e9dbc93993a1d7d4168dac08c74590ac" },
"guihua.lua": { "branch": "master", "commit": "a19ac4447021f21383fadd7a9e1fc150d0b67e1f" },
"lazy.nvim": { "branch": "main", "commit": "8d18ef44e769e98a8dc974ca85275de1d8cc7c04" },
"lualine.nvim": { "branch": "master", "commit": "e99d733e0213ceb8f548ae6551b04ae32e590c80" },
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
"mason-lspconfig": { "branch": "main", "commit": "08d074cd0c4d40e5b6033a67246f46072ecfe38e" },
"mason.nvim": { "branch": "main", "commit": "9d2e3c923ede9f5519a7ae2f82b4688cc8b1c9e9" },
"nvim-autopairs": { "branch": "master", "commit": "ab49517cfd1765b3f3de52c1f0fda6190b44e27b" },
"nvim-cmp": { "branch": "main", "commit": "01f697a68905f9dcae70960a9eb013695a17f9a2" },
"nvim-colorizer.lua": { "branch": "master", "commit": "36c610a9717cc9ec426a07c8e6bf3b3abcb139d6" },
"nvim-dap": { "branch": "master", "commit": "1cedf6895308dc553ef23115df40ebc5208e5f98" },
"nvim-lastplace": { "branch": "main", "commit": "65c5d6e2501a3af9c2cd15c6548e67fa035bf640" },
"nvim-lspconfig": { "branch": "master", "commit": "95b7a69bc6da2a6a740584ea3c555e5327638b7d" },
"nvim-pasta": { "branch": "main", "commit": "799f6b05ad026c4acaa81a7038a843cfdfd21c15" },
"nvim-tree.lua": { "branch": "master", "commit": "362ecbeed69fae91a287004619decadcb6f7c113" },
"nvim-treesitter": { "branch": "master", "commit": "e9fb90da020d08bda2a616324a64921fde3236f6" },
"nvim-web-devicons": { "branch": "master", "commit": "c2c2317f356c8b7da0252f5da758f71bb60bb6b2" },
"nvterm": { "branch": "main", "commit": "29a70ef608a8cc5db3a5fc300d39a39d1a44a863" },
"plenary.nvim": { "branch": "master", "commit": "253d34830709d690f013daf2853a9d21ad7accab" },
"pywal": { "branch": "main", "commit": "d11b673c0e3d6eb8cbee7ea8cf4a8911f6ee24b9" },
"rust-tools.nvim": { "branch": "master", "commit": "71d2cf67b5ed120a0e31b2c8adb210dd2834242f" },
"tabline.nvim": { "branch": "main", "commit": "5d76dc8616b4b7b892229cc05cd0f4cd0200077a" },
"telescope.nvim": { "branch": "0.1.x", "commit": "766a45a972408f67e793a3b63e3c419ff5458753" },
"vim-argwrap": { "branch": "master", "commit": "feaba6b8b6ca099d267c81ee2c4ba43ce6de8499" },
"vim-go": { "branch": "master", "commit": "b8a41085bfd67fee97ad075c6df65590ce7417a7" },
"vim-obsession": { "branch": "master", "commit": "fe9d3e1a9a50171e7d316a52e1e56d868e4c1fe5" },
"vim-visual-multi": { "branch": "master", "commit": "724bd53adfbaf32e129b001658b45d4c5c29ca1a" },
"vimpeccable": { "branch": "master", "commit": "bd19b2a86a3d4a0ee184412aa3edb7ed57025d56" },
"which-key.nvim": { "branch": "main", "commit": "fb027738340502b556c3f43051f113bcaa7e8e63" }
}

3
lua/.luarc.json Normal file
View File

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

1
lua/lazy.nvim Submodule

@ -0,0 +1 @@
Subproject commit 8d18ef44e769e98a8dc974ca85275de1d8cc7c04

View File

@ -1,38 +1,13 @@
--packer should install if not present and sync all plugins return {
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
return require('packer').startup({ function(use)
-- packer
use 'wbthomason/packer.nvim'
-- brrrrr (in init.lua)
use 'lewis6991/impatient.nvim'
--vimp (in mappings.lua) --vimp (in mappings.lua)
use 'svermeulen/vimpeccable' 'svermeulen/vimpeccable',
--nim 'nvim-treesitter/nvim-treesitter',
use 'alaviss/nim.nvim'
use 'nvim-treesitter/nvim-treesitter' 'ctrlpvim/ctrlp.vim',
use 'ray-x/guihua.lua' {
use 'ctrlpvim/ctrlp.vim'
use({
'fatih/vim-go', 'fatih/vim-go',
config = function() config = function()
vim.g.go_fmt_command = "gofumpt" vim.g.go_fmt_command = "gofumpt"
@ -42,58 +17,38 @@ return require('packer').startup({ function(use)
vim.g.go_highlight_function_calls = 1 vim.g.go_highlight_function_calls = 1
vim.g.go_auto_type_info = 1 vim.g.go_auto_type_info = 1
end end
}) },
use 'f-person/git-blame.nvim'
-- obsession -- obsession
use 'tpope/vim-obsession' 'tpope/vim-obsession',
--rust
use {
'simrat39/rust-tools.nvim',
config = function()
local rt = require('rust-tools')
rt.setup({
server = {
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end
}
})
end
}
--lsp (in lsp_settings.lua) --lsp (in lsp_settings.lua)
use 'neovim/nvim-lspconfig' 'neovim/nvim-lspconfig',
use 'williamboman/mason-lspconfig' 'williamboman/mason-lspconfig',
use 'williamboman/mason.nvim' 'williamboman/mason.nvim',
use 'mfussenegger/nvim-dap' 'mfussenegger/nvim-dap',
-- auto color hex/rgb -- auto color hex/rgb
use { {
'norcalli/nvim-colorizer.lua', 'norcalli/nvim-colorizer.lua',
config = function() require('colorizer').setup() end, config = function() require('colorizer').setup() end,
} },
use { {
'mrshmllow/document-color.nvim', 'mrshmllow/document-color.nvim',
config = function() config = function()
require('document-color').setup { require('document-color').setup({
mode = "background", mode = "background",
} })
end end
} },
-- Markdown preview -- Markdown preview
use { {
"iamcco/markdown-preview.nvim", "iamcco/markdown-preview.nvim",
run = "cd app && npm install", run = "cd app && npm install",
setup = function() init = function()
vim.g.mkdp_filetypes = { "markdown" } vim.g.mkdp_filetypes = { "markdown" }
vim.g.mkdp_markdown_css = os.getenv("XDG_CONFIG_HOME") .. '/nvim/static/custom.css' 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_highlight_css = os.getenv("XDG_CACHE_HOME") .. '/wal/colors.css'
@ -101,40 +56,57 @@ return require('packer').startup({ function(use)
vim.g.mkdp_echo_preview_url = 1 vim.g.mkdp_echo_preview_url = 1
end, end,
ft = { "markdown" } ft = { "markdown" }
} },
use { {
"ellisonleao/glow.nvim", "ellisonleao/glow.nvim",
cmd = "Glow",
config = function() config = function()
require('glow').setup({}) require('glow').setup({})
end end
} },
-- auto pairs -- auto pairs
use { {
'windwp/nvim-autopairs', 'windwp/nvim-autopairs',
config = function() config = function()
require('nvim-autopairs').setup {} require('nvim-autopairs').setup {}
end end
} },
-- show git diffs -- show git diffs
use { {
'lewis6991/gitsigns.nvim', 'lewis6991/gitsigns.nvim',
config = function() require('gitsigns').setup() end config = function()
} require('gitsigns').setup({
current_line_blame = true, -- Toggle with `:Gitsigns toggle_current_line_blame`
current_line_blame_opts = {
virt_text = true,
virt_text_pos = 'right_align', -- 'eol' | 'overlay' | 'right_align'
delay = 100,
ignore_whitespace = false,
},
yadm = {
enable = true
},
})
end
},
-- fuzzy finder -- fuzzy finder
use { {
'nvim-telescope/telescope.nvim', 'nvim-telescope/telescope.nvim',
branch = '0.1.x', branch = '0.1.x',
requires = { dependencies = {
{
'nvim-lua/plenary.nvim', 'nvim-lua/plenary.nvim',
lazy = true
},
} }
} },
-- file explorer -- file explorer
use { {
'kyazdani42/nvim-tree.lua', 'kyazdani42/nvim-tree.lua',
config = function() config = function()
require('nvim-tree').setup { require('nvim-tree').setup {
@ -152,34 +124,34 @@ return require('packer').startup({ function(use)
}, },
} }
end end
} },
-- open file at last location -- open file at last location
use { {
'ethanholz/nvim-lastplace', 'ethanholz/nvim-lastplace',
config = function() config = function()
require('nvim-lastplace').setup { require('nvim-lastplace').setup {
lastplace_open_folds = true lastplace_open_folds = true
} }
end end
} },
-- multiple cursors -- multiple cursors
use 'mg979/vim-visual-multi' 'mg979/vim-visual-multi',
-- wrap things inside pairs -- wrap things inside pairs
use 'FooSoft/vim-argwrap' 'FooSoft/vim-argwrap',
-- which key -- which key
use { {
"folke/which-key.nvim", "folke/which-key.nvim",
config = function() config = function()
require("which-key").setup {} require("which-key").setup {}
end end
} },
-- pasting indents -- pasting indents
use { {
'hrsh7th/nvim-pasta', 'hrsh7th/nvim-pasta',
config = function() config = function()
require('pasta').setup { require('pasta').setup {
@ -191,11 +163,11 @@ return require('packer').startup({ function(use)
prev_key = vim.api.nvim_replace_termcodes('<C-n>', true, true, true), prev_key = vim.api.nvim_replace_termcodes('<C-n>', true, true, true),
} }
end end
} },
use { {
"hrsh7th/nvim-cmp", "hrsh7th/nvim-cmp",
requires = { dependencies = {
{ "hrsh7th/cmp-nvim-lsp" }, { "hrsh7th/cmp-nvim-lsp" },
{ "hrsh7th/cmp-nvim-lua" }, { "hrsh7th/cmp-nvim-lua" },
{ "hrsh7th/cmp-buffer" }, { "hrsh7th/cmp-buffer" },
@ -244,7 +216,7 @@ return require('packer').startup({ function(use)
}) })
}) })
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore). -- buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', { cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { sources = {
@ -252,7 +224,7 @@ return require('packer').startup({ function(use)
} }
}) })
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore). -- cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', { cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ sources = cmp.config.sources({
@ -262,10 +234,10 @@ return require('packer').startup({ function(use)
}) })
}) })
end, end,
} },
-- terminal toggler -- terminal toggler
use { {
"NvChad/nvterm", "NvChad/nvterm",
config = function() config = function()
require("nvterm").setup() require("nvterm").setup()
@ -280,69 +252,61 @@ return require('packer').startup({ function(use)
vim.keymap.set(mapping[1], mapping[2], mapping[3], opts) vim.keymap.set(mapping[1], mapping[2], mapping[3], opts)
end end
end end
} },
--- THEME STUFF --- THEME STUFF
-- colors -- colors
use { {
'AlphaTechnolog/pywal.nvim', 'AlphaTechnolog/pywal.nvim',
as = 'pywal', name = 'pywal',
config = function() config = function()
local pywal = require('pywal') local pywal = require('pywal')
pywal.setup() pywal.setup()
end end
} },
-- better statusbar -- better statusbar
use { {
'hoob3rt/lualine.nvim', 'hoob3rt/lualine.nvim',
requires = { { 'kyazdani42/nvim-web-devicons', opt = true } }, dependencies = { { 'kyazdani42/nvim-web-devicons', lazy = true }, 'pywal' },
config = function() config = function()
vim.g.gitblame_display_virtual_text = 0 -- Disable virtual text
local git_blame = require('gitblame')
require('lualine').setup({ require('lualine').setup({
sections = {
lualine_c = {
{ git_blame.get_current_blame_text, cond = git_blame.is_blame_text_available }
},
},
options = { options = {
theme = 'pywal-nvim' theme = 'pywal-nvim'
} }
}) })
end, end,
after = 'pywal' },
}
-- better tabs -- better tabs
use { {
'kdheepak/tabline.nvim', 'kdheepak/tabline.nvim',
requires = { { 'kyazdani42/nvim-web-devicons', opt = true } }, dependencies = { { 'kyazdani42/nvim-web-devicons', lazy = true }, 'pywal' },
config = function() config = function()
require('tabline').setup({ options = { theme = 'pywal-nvim' } }) require('tabline').setup({ options = { theme = 'pywal-nvim' } })
end, end,
after = { 'pywal' } },
}
-- fwatch updates colors automatically -- fwatch updates colors automatically
use { {
'rktjmp/fwatch.nvim', 'rktjmp/fwatch.nvim',
dependencies = { 'pywal' },
config = function() 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() {
on_event = function()
vim.defer_fn(function() vim.defer_fn(function()
vim.cmd('colorscheme pywal') vim.cmd('colorscheme pywal')
end, 100) end, 100)
end }) end
})
end, end,
after = 'pywal' },
}
-- greeter -- greeter
use { {
'goolord/alpha-nvim', 'goolord/alpha-nvim',
dependencies = { 'kyazdani42/nvim-web-devicons' },
requires = { 'kyazdani42/nvim-web-devicons' },
config = function() config = function()
local alpha = require('alpha') local alpha = require('alpha')
local dashboard = require('alpha.themes.dashboard') local dashboard = require('alpha.themes.dashboard')
@ -380,16 +344,5 @@ return require('packer').startup({ function(use)
end end
alpha.setup(dashboard.opts) alpha.setup(dashboard.opts)
end end
},
} }
if packer_bootstrap then
require('packer').sync()
end
end,
config = {
display = {
open_fn = function()
return require('packer.util').float({ border = 'single' })
end
}
} })

395
lua/pluginsbackup.lua Normal file
View File

@ -0,0 +1,395 @@
--packer should install if not present and sync all plugins
local ensure_packer = function()
local fn = vim.fn
local install_path = fn.stdpath('data') .. '/site/pack/packer/start/packer.nvim'
if fn.empty(fn.glob(install_path)) > 0 then
fn.system({ 'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path })
vim.cmd [[packadd packer.nvim]]
return true
end
return false
end
local packer_bootstrap = ensure_packer()
return require('packer').startup({ function(use)
-- packer
use 'wbthomason/packer.nvim'
-- brrrrr (in init.lua)
use 'lewis6991/impatient.nvim'
--vimp (in mappings.lua)
use 'svermeulen/vimpeccable'
--nim
use 'alaviss/nim.nvim'
use 'nvim-treesitter/nvim-treesitter'
use 'ray-x/guihua.lua'
use 'ctrlpvim/ctrlp.vim'
use({
'fatih/vim-go',
config = function()
vim.g.go_fmt_command = "gofumpt"
vim.g.go_highlight_types = 1
vim.g.go_highlight_fields = 1
vim.g.go_highlight_functions = 1
vim.g.go_highlight_function_calls = 1
vim.g.go_auto_type_info = 1
end
})
use 'f-person/git-blame.nvim'
-- obsession
use 'tpope/vim-obsession'
--rust
use {
'simrat39/rust-tools.nvim',
config = function()
local rt = require('rust-tools')
rt.setup({
server = {
on_attach = function(_, bufnr)
-- Hover actions
vim.keymap.set("n", "<C-space>", rt.hover_actions.hover_actions, { buffer = bufnr })
-- Code action groups
vim.keymap.set("n", "<Leader>a", rt.code_action_group.code_action_group, { buffer = bufnr })
end
}
})
end
}
--lsp (in lsp_settings.lua)
use 'neovim/nvim-lspconfig'
use 'williamboman/mason-lspconfig'
use 'williamboman/mason.nvim'
use 'mfussenegger/nvim-dap'
-- auto color hex/rgb
use {
'norcalli/nvim-colorizer.lua',
config = function() require('colorizer').setup() end,
}
use {
'mrshmllow/document-color.nvim',
config = function()
require('document-color').setup {
mode = "background",
}
end
}
-- Markdown preview
use {
"iamcco/markdown-preview.nvim",
run = "cd app && npm install",
setup = 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 = 'surf'
vim.g.mkdp_echo_preview_url = 1
end,
ft = { "markdown" }
}
use {
"ellisonleao/glow.nvim",
config = function()
require('glow').setup({})
end
}
-- auto pairs
use {
'windwp/nvim-autopairs',
config = function()
require('nvim-autopairs').setup {}
end
}
-- show git diffs
use {
'lewis6991/gitsigns.nvim',
config = function() require('gitsigns').setup() end
}
-- fuzzy finder
use {
'nvim-telescope/telescope.nvim',
branch = '0.1.x',
requires = {
'nvim-lua/plenary.nvim',
}
}
-- file explorer
use {
'kyazdani42/nvim-tree.lua',
config = function()
require('nvim-tree').setup {
sort_by = "case_sensitive",
view = {
adaptive_size = true,
mappings = {
list = {
{ key = "u", action = "dir_up" },
},
},
},
renderer = {
group_empty = true,
},
}
end
}
-- open file at last location
use {
'ethanholz/nvim-lastplace',
config = function()
require('nvim-lastplace').setup {
lastplace_open_folds = true
}
end
}
-- multiple cursors
use 'mg979/vim-visual-multi'
-- wrap things inside pairs
use 'FooSoft/vim-argwrap'
-- which key
use {
"folke/which-key.nvim",
config = function()
require("which-key").setup {}
end
}
-- pasting indents
use {
'hrsh7th/nvim-pasta',
config = function()
require('pasta').setup {
converters = {
require('pasta.converters').indentation,
},
paste_mode = true,
next_key = vim.api.nvim_replace_termcodes('<C-p>', true, true, true),
prev_key = vim.api.nvim_replace_termcodes('<C-n>', true, true, true),
}
end
}
use {
"hrsh7th/nvim-cmp",
requires = {
{ "hrsh7th/cmp-nvim-lsp" },
{ "hrsh7th/cmp-nvim-lua" },
{ "hrsh7th/cmp-buffer" },
{ "hrsh7th/cmp-path" },
{ "hrsh7th/cmp-cmdline" },
{ "L3MON4D3/LuaSnip" },
{ "saadparwaiz1/cmp_luasnip" },
{ "rafamadriz/friendly-snippets" },
{ "f3fora/cmp-spell", { "hrsh7th/cmp-calc" }, { "hrsh7th/cmp-emoji" } },
},
config = function()
require('luasnip.loaders.from_vscode').lazy_load()
local cmp = require 'cmp'
cmp.setup({
snippet = {
-- REQUIRED - you must specify a snippet engine
expand = function(args)
require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
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 = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}),
sources = cmp.config.sources({
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
}, {
{ name = 'buffer' },
})
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = 'buffer' },
})
})
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline('/', {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = 'buffer' }
}
})
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = 'path' }
}, {
{ name = 'cmdline' }
})
})
end,
}
-- terminal toggler
use {
"NvChad/nvterm",
config = function()
require("nvterm").setup()
local toggle_modes = { 'n', 't' }
local mappings = {
{ toggle_modes, '<leader>th', function() require("nvterm.terminal").toggle('horizontal') end },
{ toggle_modes, '<leader>tv', function() require("nvterm.terminal").toggle('vertical') end },
{ toggle_modes, '<leader>tf', function() require("nvterm.terminal").toggle('float') end },
}
local opts = { noremap = true, silent = true }
for _, mapping in ipairs(mappings) do
vim.keymap.set(mapping[1], mapping[2], mapping[3], opts)
end
end
}
--- THEME STUFF
-- colors
use {
'AlphaTechnolog/pywal.nvim',
as = 'pywal',
config = function()
local pywal = require('pywal')
pywal.setup()
end
}
-- better statusbar
use {
'hoob3rt/lualine.nvim',
requires = { { 'kyazdani42/nvim-web-devicons', opt = true } },
config = function()
vim.g.gitblame_display_virtual_text = 0 -- Disable virtual text
local git_blame = require('gitblame')
require('lualine').setup({
sections = {
lualine_c = {
{ git_blame.get_current_blame_text, cond = git_blame.is_blame_text_available }
},
},
options = {
theme = 'pywal-nvim'
}
})
end,
after = 'pywal'
}
-- better tabs
use {
'kdheepak/tabline.nvim',
requires = { { 'kyazdani42/nvim-web-devicons', opt = true } },
config = function()
require('tabline').setup({ options = { theme = 'pywal-nvim' } })
end,
after = { 'pywal' }
}
-- fwatch updates colors automatically
use {
'rktjmp/fwatch.nvim',
config = function()
require('fwatch').watch(os.getenv("XDG_CACHE_HOME") .. "/wal/colors",
{ on_event = function()
vim.defer_fn(function()
vim.cmd('colorscheme pywal')
end, 100)
end })
end,
after = 'pywal'
}
-- greeter
use {
'goolord/alpha-nvim',
requires = { 'kyazdani42/nvim-web-devicons' },
config = function()
local alpha = require('alpha')
local dashboard = require('alpha.themes.dashboard')
dashboard.section.header.val = {
[[ ▄▄▄ ▄▄▄▄ ██████ ███▄ █ ▄▄▄█████▓]],
[[▒████▄ ▓█████▄ ▒██ ▒ ██ ▀█ █ ▓ ██▒ ▓▒]],
[[▒██ ▀█▄ ▒██▒ ▄██░ ▓██▄ ▓██ ▀█ ██▒▒ ▓██░ ▒░]],
[[░██▄▄▄▄██ ▒██░█▀ ▒ ██▒▓██▒ ▐▌██▒░ ▓██▓ ░ ]],
[[ ▓█ ▓██▒░▓█ ▀█▓▒██████▒▒▒██░ ▓██░ ▒██▒ ░ ]],
[[ ▒▒ ▓▒█░░▒▓███▀▒▒ ▒▓▒ ▒ ░░ ▒░ ▒ ▒ ▒ ░░ ]],
[[ ▒ ▒▒ ░▒░▒ ░ ░ ░▒ ░ ░░ ░░ ░ ▒░ ░ ]],
[[ ░ ▒ ░ ░ ░ ░ ░ ░ ░ ░ ░ ]],
[[ ░ ░ ░ ░ ░ ]],
[[ ░ ]]
}
dashboard.section.buttons.val = {
dashboard.button("e", " New file", ":ene <BAR> startinsert <CR>"),
dashboard.button("r", " Recently used files", ":Telescope oldfiles<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("q", " Quit NVIM", ":qa<CR>"),
}
local handle = assert(io.popen('fortune -s'))
local fortune = handle:read("*all")
handle:close()
dashboard.section.footer.val = fortune
dashboard.section.header.opts.hl = "Title"
dashboard.section.buttons.opts.hl = "Debug"
dashboard.section.footer.opts.hl = "Conceal"
dashboard.config.opts.noautocmd = true
dashboard.config.opts.setup = function()
vim.b.lnstatus = "nonumber"
end
alpha.setup(dashboard.opts)
end
}
if packer_bootstrap then
require('packer').sync()
end
end,
config = {
display = {
open_fn = function()
return require('packer.util').float({ border = 'single' })
end
}
} })