Moving to lazy nvim

Signed-off-by: Taken <taken@mairimashita.org>
This commit is contained in:
2023-08-22 14:51:21 +02:00
parent 128bf12422
commit ce905b45fb
30 changed files with 221 additions and 159 deletions

View File

@@ -1,4 +1,5 @@
require("taken.lazy")
require("taken.core")
require("taken.plugin")
require("taken.pluginloader")
vim.notify = require("notify")
-- vim.notify = require("notify")

144
lua/taken/lazy.lua Normal file
View File

@@ -0,0 +1,144 @@
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("lazy").setup({
{
"catppuccin/nvim",
name = "catppuccin",
priority = 1000,
},
{ "folke/tokyonight.nvim", priority = 1000 },
{ "Mofiqul/dracula.nvim", priority = 1000 },
{ "roflolilolmao/oceanic-next.nvim", priority = 1000 },
{ "olimorris/onedarkpro.nvim", priority = 1000 },
{ "NTBBloodbath/doom-one.nvim", priority = 1000 },
{ "shaunsingh/moonlight.nvim", priority = 1000 },
{ "kvrohit/mellow.nvim", priority = 1000 },
-- telescope
{
"nvim-telescope/telescope.nvim",
version = "0.1.1",
dependencies = { "nvim-lua/plenary.nvim" },
},
{
"nvim-telescope/telescope-file-browser.nvim",
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
},
{
"nvim-telescope/telescope-project.nvim",
dependencies = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
},
{
"nvim-telescope/telescope-fzf-native.nvim",
build = "make",
dependencies = { "nvim-telescope/telescope.nvim" },
},
{
"VonHeikemen/fine-cmdline.nvim",
dependencies = {
{ "MunifTanjim/nui.nvim" },
},
},
-- development
"github/copilot.vim",
{
"nvim-tree/nvim-tree.lua",
dependencies = { "nvim-tree/nvim-web-devicons" },
},
{ "nvim-treesitter/nvim-treesitter", build = ":TSUpdate" },
--lsp
{
"williamboman/mason.nvim",
build = function()
pcall(vim.cmd, "MasonUpdate")
end,
},
"neovim/nvim-lspconfig",
{
"williamboman/mason-lspconfig.nvim",
dependencies = { "williamboman/mason.nvim", "neovim/nvim-lspconfig" },
},
-- formatters and linters
"jose-elias-alvarez/null-ls.nvim",
{
"jayp0521/mason-null-ls.nvim",
dependencies = { "williamboman/mason.nvim", "jose-elias-alvarez/null-ls.nvim" },
},
-- completion
"hrsh7th/nvim-cmp",
"hrsh7th/cmp-nvim-lsp",
"hrsh7th/cmp-buffer",
"hrsh7th/cmp-path",
-- snippets
"L3MON4D3/LuaSnip",
"saadparwaiz1/cmp_luasnip",
"rafamadriz/friendly-snippets",
"onsails/lspkind.nvim",
{
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
},
{
"iamcco/markdown-preview.nvim",
build = function()
vim.fn["mkdp#util#install"]()
end,
},
"numToStr/Comment.nvim",
{ "NeogitOrg/neogit", dependencies = "nvim-lua/plenary.nvim" },
"sindrets/diffview.nvim",
"windwp/nvim-autopairs",
{ "windwp/nvim-ts-autotag", dependencies = "nvim-treesitter" },
"lewis6991/gitsigns.nvim",
"f-person/git-blame.nvim",
-- useful plugins
{
"glepnir/dashboard-nvim",
event = "VimEnter",
dependencies = { "nvim-tree/nvim-web-devicons" },
},
{
"nvim-neorg/neorg",
build = ":Neorg sync-parsers",
dependencies = "nvim-lua/plenary.nvim",
},
{
"NvChad/nvim-colorizer.lua",
config = function()
require("colorizer").setup({})
end,
},
"folke/which-key.nvim",
{
"nvim-lualine/lualine.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
},
{ "akinsho/toggleterm.nvim", version = "*" },
"rcarriga/nvim-notify",
{
"akinsho/bufferline.nvim",
version = "*",
dependencies = "nvim-tree/nvim-web-devicons"
},
"TakenMC/presence.nvim",
{
"kylechui/nvim-surround",
version = "*",
config = function()
require("nvim-surround").setup({})
end,
},
"ObserverOfTime/nvimcord",
"xiyaowong/transparent.nvim",
"jokajak/keyseer.nvim",
})

View File

@@ -1 +0,0 @@
require("taken.plugin.packer")

View File

@@ -1,156 +0,0 @@
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() -- true if packer was just installed
vim.cmd([[packadd packer.nvim]])
-- import packer safely
local status, packer = pcall(require, "packer")
if not status then
return
end
return packer.startup({
function(use)
--Packer
use("wbthomason/packer.nvim")
--Themes
use({ "catppuccin/nvim", as = "catppuccin" })
use("folke/tokyonight.nvim")
use("Mofiqul/dracula.nvim")
use("roflolilolmao/oceanic-next.nvim")
use("olimorris/onedarkpro.nvim")
use("NTBBloodbath/doom-one.nvim")
use("shaunsingh/moonlight.nvim")
use("kvrohit/mellow.nvim")
-- telescope
use({
"nvim-telescope/telescope.nvim",
tag = "0.1.1",
requires = { { "nvim-lua/plenary.nvim" } },
})
use({
"nvim-telescope/telescope-file-browser.nvim",
requires = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
})
use({
"nvim-telescope/telescope-project.nvim",
requires = { "nvim-telescope/telescope.nvim", "nvim-lua/plenary.nvim" },
})
use({
"nvim-telescope/telescope-fzf-native.nvim",
run = "make",
requires = { "nvim-telescope/telescope.nvim" },
})
use({
"VonHeikemen/fine-cmdline.nvim",
requires = {
{ "MunifTanjim/nui.nvim" },
},
})
-- development
use("github/copilot.vim")
use({
"nvim-tree/nvim-tree.lua",
requires = { { "nvim-tree/nvim-web-devicons" } },
})
use({ "nvim-treesitter/nvim-treesitter", run = ":TSUpdate" })
--lsp
use({
"williamboman/mason.nvim",
run = function()
pcall(vim.cmd, "MasonUpdate")
end,
})
use({ "neovim/nvim-lspconfig" })
use({ "williamboman/mason-lspconfig.nvim" })
-- formatters and linters
use("jose-elias-alvarez/null-ls.nvim")
use("jayp0521/mason-null-ls.nvim")
-- completion
use({ "hrsh7th/nvim-cmp" })
use({ "hrsh7th/cmp-nvim-lsp" })
use("hrsh7th/cmp-buffer")
use("hrsh7th/cmp-path")
-- snippets
use("L3MON4D3/LuaSnip")
use("saadparwaiz1/cmp_luasnip")
use("rafamadriz/friendly-snippets")
use("onsails/lspkind.nvim")
use({
"folke/trouble.nvim",
requires = { "nvim-tree/nvim-web-devicons" },
})
use({
"iamcco/markdown-preview.nvim",
run = function()
vim.fn["mkdp#util#install"]()
end,
})
use({
"numToStr/Comment.nvim",
config = function() end,
})
use({ "NeogitOrg/neogit", requires = "nvim-lua/plenary.nvim" })
use("sindrets/diffview.nvim")
use("windwp/nvim-autopairs")
use({ "windwp/nvim-ts-autotag", after = "nvim-treesitter" })
use("lewis6991/gitsigns.nvim")
use("f-person/git-blame.nvim")
-- useful plugins
use({
"glepnir/dashboard-nvim",
event = "VimEnter",
requires = { "nvim-tree/nvim-web-devicons" },
})
use({
"nvim-neorg/neorg",
run = ":Neorg sync-parsers",
requires = "nvim-lua/plenary.nvim",
})
use({
"NvChad/nvim-colorizer.lua",
config = function()
require("colorizer").setup({})
end,
})
use("folke/which-key.nvim")
use({
"nvim-lualine/lualine.nvim",
requires = { "nvim-tree/nvim-web-devicons", opt = true },
})
use({ "akinsho/toggleterm.nvim", tag = "*" })
use("rcarriga/nvim-notify")
use({ "akinsho/bufferline.nvim", tag = "*", requires = "nvim-tree/nvim-web-devicons" })
use("TakenMC/presence.nvim")
use({
"kylechui/nvim-surround",
tag = "*",
config = function()
require("nvim-surround").setup({})
end,
})
use("ObserverOfTime/nvimcord")
use("xiyaowong/transparent.nvim")
use("jokajak/keyseer.nvim")
-- packer autosync
if packer_bootstrap then
require("packer").sync()
end
end,
config = {
display = {
open_fn = function()
return require("packer.util").float({ border = "single" })
end,
},
},
})

View File

@@ -0,0 +1,17 @@
local configDir = vim.fn.stdpath("config")
local configFiles = vim.fn.readdir(configDir .. "/lua/taken/plugins")
local lspFiles = vim.fn.readdir(configDir .. "/lua/taken/plugins/lsp")
for _, file in pairs(configFiles) do
if file:match("%.lua$") then
local name = file:gsub("%.lua$", "")
require("taken.plugins." .. name)
end
end
for _, file in pairs(lspFiles) do
if file:match("%.lua$") then
local name = file:gsub("%.lua$", "")
require("taken.plugins.lsp." .. name)
end
end

View File

@@ -0,0 +1,13 @@
local autopairs_setup, autopairs = pcall(require, "nvim-autopairs")
if not autopairs_setup then
return
end
autopairs.setup {
check_ts = true,
ts_config = {
lua = { "string" },
javascript = { "template_string" },
java = false,
},
}

View File

@@ -0,0 +1,62 @@
local setup, bufferline = pcall(require, "bufferline")
if not setup then
return
end
bufferline.setup {
options = {
mode = "buffers",
style_preset = bufferline.style_preset.default,
themable = true,
numbers = "none",
close_command = "bdelete! %d",
indicator = {
icon = "",
style = "icon"
},
max_name_length = 18,
max_prefix_length = 15,
truncate_names = true,
tab_size = 18,
offsets = {
{
filetype = "NvimTree",
text = "File Explorer",
highlight = "None",
padding = 1
}
},
color_icons = true,
get_element_icon = function(element)
local icon, hl = require('nvim-web-devicons').get_icon_by_filetype(element.filetype, { default = false })
return icon, hl
end,
always_show_bufferline = true,
diagnostics = "nvim_lsp",
diagnostics_update_in_insert = false,
diagnostics_indicator = function(count, level, diagnostics_dict, context)
if context.buffer:current() then
return ''
end
return ''
end,
highlights = {
background = {
guibg = "None",
},
fill = {
guibg = "None",
},
close_button = {
guibg = "None",
},
separator_visible = {
guibg = "None",
},
tab_close = {
guibg = "None",
},
},
}
}

View File

@@ -0,0 +1,27 @@
local status, cmdline = pcall(require, "fine-cmdline")
if not status then
return
end
cmdline.setup({
cmdline = {
enable_keymaps = true,
smart_history = true,
prompt = "> ",
},
popup = {
position = {
row = "10%",
col = "50%",
},
size = {
width = "80%",
},
border = {
style = "rounded",
},
win_options = {
winhighlight = "Normal:Normal,FloatBorder:FloatBorder",
},
},
})

View File

@@ -0,0 +1,29 @@
local setup, comment = pcall(require, "Comment")
if not setup then
return
end
comment.setup({
padding = true,
sticky = true,
ignore = nil,
toggler = {
line = 'gcc',
block = 'gbc',
},
opleader = {
line = 'gc',
block = 'gb',
},
extra = {
above = 'gcO',
below = 'gco',
eol = 'gcA',
},
mappings = {
basic = true,
extra = true,
},
pre_hook = nil,
post_hook = nil,
})

View File

@@ -0,0 +1,83 @@
local staus, db = pcall(require, "dashboard")
if not staus then
return
end
local version = vim.version().major .. "." .. vim.version().minor .. "." .. vim.version().patch
local dataPath = vim.fn.stdpath("data")
local startDir = vim.fn.globpath(dataPath .. "\\site\\pack\\packer\\start", "*", 0, 1)
local optDir = vim.fn.globpath(dataPath .. "\\site\\pack\\packer\\opt", "*", 0, 1)
local plugins_count = vim.fn.len(startDir) + vim.fn.len(optDir)
local time = vim.fn.strftime("%H:%M:%S")
local date = vim.fn.strftime("%d.%m.%Y")
db.setup({
theme = "doom",
config = {
header = {
[[ ]],
[[ ================= =============== =============== ======== ======== ]],
[[ \\ . . . . . . .\\ //. . . . . . .\\ //. . . . . . .\\ \\. . .\\// . . // ]],
[[ ||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\/ . . .|| ]],
[[ || . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . || ]],
[[ ||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .|| ]],
[[ || . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\ . . . . || ]],
[[ ||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\_ . .|. .|| ]],
[[ || . _|| || || || || ||_ . || || . _|| || || || |\ `-_/| . || ]],
[[ ||_-' || .|/ || || \|. || `-_|| ||_-' || .|/ || || | \ / |-_.|| ]],
[[ || ||_-' || || `-_|| || || ||_-' || || | \ / | `|| ]],
[[ || `' || || `' || || `' || || | \ / | || ]],
[[ || .===' `===. .==='.`===. .===' /==. | \/ | || ]],
[[ || .==' \_|-_ `===. .===' _|_ `===. .===' _-|/ `== \/ | || ]],
[[ || .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \/ | || ]],
[[ || .==' _-' `-__\._-' `-_./__-' `' |. /| | || ]],
[[ ||.==' _-' `' | /==.|| ]],
[[ ==' _-' \/ `== ]],
[[ \ _-' `-_ / ]],
[[ `'' ``' ]],
[[ [ TIP: To exit Neovim, just power off your computer. ] ]],
[[ ]],
},
center = {
{
icon = '󰍉 ',
icon_hl = 'main',
desc = 'Find files',
desc_hl = 'main',
key = 'f',
key_hl = 'main',
action = 'Telescope find_files',
},
{
icon = '',
icon_hl = 'main',
desc = 'Select project',
desc_hl = 'main',
key = 'p',
key_hl = 'main',
action = 'Telescope project',
},
{
icon = '',
icon_hl = 'main',
desc = 'Neorg',
desc_hl = 'main',
key = 'n',
key_hl = 'main',
action = 'Neorg workspace main',
},
{
icon = '󰚰 ',
icon_hl = 'main',
desc = 'Packer sync',
desc_hl = 'main',
key = 'P',
key_hl = 'main',
action = 'PackerSync',
},
},
footer = {
"" .. version .. " " .. plugins_count .. ' plugins 󰃭 ' .. date .. '' .. time,
}
}
})

View File

@@ -0,0 +1,6 @@
local setup, gitsigns = pcall(require, 'gitsigns')
if not setup then
return
end
gitsigns.setup {}

View File

@@ -0,0 +1,52 @@
local status, keyseer = pcall(require, "keyseer")
if not status then
return
end
keyseer.setup({
debug = false,
initial_mode = "n",
include_builtin_keymaps = true,
include_global_keymaps = true,
include_buffer_keymaps = true,
include_modified_keypresses = false,
ignore_whichkey_conflicts = true,
ui = {
border = "double",
margin = { 1, 0, 1, 0 },
winblend = 0,
size = {
width = 65,
height = 10,
},
icons = {
keyseer = "",
},
show_header = true,
},
keyboard = {
layout = "qwertz",
keycap_padding = { 0, 1, 0, 1 },
highlight_padding = { 0, 0, 0, 0 },
key_labels = {
["Up"] = "",
["Down"] = "",
["Left"] = "",
["Right"] = "",
["<F1>"] = "F1",
["<F2>"] = "F2",
["<F3>"] = "F3",
["<F4>"] = "F4",
["<F5>"] = "F5",
["<F6>"] = "F6",
["<F7>"] = "F7",
["<F8>"] = "F8",
["<F9>"] = "F9",
["<F10>"] = "F10",
-- ["<space>"] = "SPC",
-- ["<cr>"] = "RET",
-- ["<tab>"] = "TAB",
},
},
})

View File

@@ -0,0 +1,10 @@
-- markdown preview
vim.cmd([[
let g:mkdp_auto_close = 0
let g:mkdp_theme = 'dark'
]])
-- git blame
vim.cmd([[
let g:gitblame_enabled = 1
]])

View File

@@ -0,0 +1,41 @@
local lsp = require('lsp-zero').preset({})
local lspconfig = require('lspconfig')
lsp.on_attach(function(client, bufnr)
lsp.default_keymaps({buffer = bufnr})
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end)
lsp.ensure_installed({
'lua_ls',
'tsserver',
'rust_analyzer',
})
lspconfig.lua_ls.setup(lsp.nvim_lua_ls())
lspconfig.tsserver.setup({})
lsp.setup()
local cmp = require('cmp')
local cmp_select = {behavior = cmp.SelectBehavior.Select}
local cmp_mappings = lsp.defaults.cmp_mappings({
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<CR>'] = cmp.mapping.confirm({ select = true }),
["<C-Space>"] = cmp.mapping.complete(),
})
lsp.setup_nvim_cmp({
mapping = cmp_mappings
})
cmp_mappings['<Tab>'] = nil
cmp_mappings['<S-Tab>'] = nil

View File

@@ -0,0 +1,63 @@
local lspconfig_status, lspconfig = pcall(require, "lspconfig")
if not lspconfig_status then
return
end
local cmp_nvim_lsp_status, cmp_nvim_lsp = pcall(require, "cmp_nvim_lsp")
if not cmp_nvim_lsp_status then
return
end
local on_attach = function(client, bufnr)
local opts = { noremap = true, silent = true, buffer = bufnr }
vim.keymap.set("n", "gd", function() vim.lsp.buf.definition() end, opts)
vim.keymap.set("n", "K", function() vim.lsp.buf.hover() end, opts)
vim.keymap.set("n", "<leader>vws", function() vim.lsp.buf.workspace_symbol() end, opts)
vim.keymap.set("n", "<leader>vd", function() vim.diagnostic.open_float() end, opts)
vim.keymap.set("n", "[d", function() vim.diagnostic.goto_next() end, opts)
vim.keymap.set("n", "]d", function() vim.diagnostic.goto_prev() end, opts)
vim.keymap.set("n", "<leader>vca", function() vim.lsp.buf.code_action() end, opts)
vim.keymap.set("n", "<leader>vrr", function() vim.lsp.buf.references() end, opts)
vim.keymap.set("n", "<leader>vrn", function() vim.lsp.buf.rename() end, opts)
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
end
local capabilities = cmp_nvim_lsp.default_capabilities()
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 = "" })
end
lspconfig["lua_ls"].setup({
capabilities = capabilities,
on_attach = on_attach,
settings = {
Lua = {
diagnostics = {
globals = { "vim" },
},
},
},
})
lspconfig["html"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
lspconfig["tsserver"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
lspconfig["cssls"].setup({
capabilities = capabilities,
on_attach = on_attach,
})
lspconfig["pyright"].setup({
capabilities = capabilities,
on_attach = on_attach,
})

View File

@@ -0,0 +1,36 @@
local mason_status, mason = pcall(require, "mason")
if not mason_status then
return
end
local mason_lspconfig_status, mason_lspconfig = pcall(require, "mason-lspconfig")
if not mason_lspconfig_status then
return
end
local mason_null_ls_status, mason_null_ls = pcall(require, "mason-null-ls")
if not mason_null_ls_status then
return
end
mason.setup()
mason_lspconfig.setup({
ensure_installed = {
"tsserver",
"html",
"cssls",
"lua_ls",
"pyright",
},
automatic_installation = true,
})
mason_null_ls.setup({
ensure_installed = {
"stylua",
"clang_format",
"eslint_d",
},
automatic_installation = true,
})

View File

@@ -0,0 +1,19 @@
local setup, null_ls = pcall(require, "null-ls")
if not setup then
return
end
local formatting = null_ls.builtins.formatting
local diagnostics = null_ls.builtins.diagnostics
null_ls.setup({
sources = {
formatting.stylua,
diagnostics.eslint_d.with({
condition = function(utils)
return utils.root_has_file(".eslintrc.js")
end,
}),
formatting.clang_format,
},
})

View File

@@ -0,0 +1,45 @@
local setup, lualine = pcall(require, 'lualine')
if not setup then
return
end
lualine.setup {
options = {
icons_enabled = true,
theme = 'auto',
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {
statusline = {},
winbar = {},
},
ignore_focus = {},
always_divide_middle = true,
globalstatus = false,
refresh = {
statusline = 1000,
tabline = 1000,
winbar = 1000,
}
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', 'diagnostics'},
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_y = {},
lualine_z = {}
},
tabline = {},
winbar = {},
inactive_winbar = {},
extensions = {}
}

View File

@@ -0,0 +1,58 @@
local setup, neogit = pcall(require, "neogit")
if not setup then
return
end
neogit.setup({
auto_refresh = true,
remember_settings = true,
disable_insert_on_commit = false,
commit_popup = {
kind = "split",
},
preview_buffer = {
kind = "split",
},
popup = {
kind = "split",
},
signs = {
section = { "", "" },
item = { "", "" },
hunk = { "", "" },
},
integrations = {
diffview = true,
},
sections = {
untracked = {
folded = false,
},
unstaged = {
folded = false,
},
staged = {
folded = false,
},
stashes = {
folded = true,
},
unpulled = {
folded = true,
hidden = false,
},
unmerged = {
folded = false,
hidden = false,
},
recent = {
folded = true,
},
},
mappings = {
status = {
["p"] = "PushPopup",
["P"] = "PullPopup",
},
},
})

View File

@@ -0,0 +1,18 @@
local status, neorg = pcall(require, "neorg")
if not status then
return
end
neorg.setup({
load = {
["core.defaults"] = {},
["core.concealer"] = {},
["core.dirman"] = {
config = {
workspaces = {
main = "~/neorg/main",
},
},
},
},
})

View File

@@ -0,0 +1,47 @@
local cmp_status, cmp = pcall(require, "cmp")
if not cmp_status then
return
end
local luasnip_status, luasnip = pcall(require, "luasnip")
if not luasnip_status then
return
end
local lspkind_status, lspkind = pcall(require, "lspkind")
if not lspkind_status then
return
end
require("luasnip/loaders/from_vscode").lazy_load()
vim.opt.completeopt = "menu,menuone,noselect"
cmp.setup({
snippet = {
expand = function(args)
luasnip.lsp_expand(args.body)
end,
},
mapping = cmp.mapping.preset.insert({
["<C-p>"] = cmp.mapping.select_prev_item(), -- previous suggestion
["<C-n>"] = cmp.mapping.select_next_item(), -- next suggestion
["<C-Space>"] = cmp.mapping.complete(), -- show completion suggestions
["<CR>"] = cmp.mapping.confirm({ select = false }),
['<Tab>'] = nil,
['<S-Tab>'] = nil
}),
sources = cmp.config.sources({
{ name = "nvim_lsp" }, -- lsp
{ name = "luasnip" }, -- snippets
{ name = "buffer" }, -- text within current buffer
{ name = "path" }, -- file system paths
}),
formatting = {
format = lspkind.cmp_format({
maxwidth = 50,
ellipsis_char = "...",
}),
},
})

View File

@@ -0,0 +1,17 @@
local setup, nvimcord = pcall(require, 'nvimcord')
if not setup then
return
end
nvimcord.setup {
autostart = false,
client_id = '954365489214291979',
large_file_icon = false,
log_level = vim.log.levels.DEBUG,
workspace_name = function()
return vim.cmd [[pwd]]
end,
workspace_url = function()
return ''
end,
}

View File

@@ -0,0 +1,24 @@
local setup, nvimtree = pcall(require, "nvim-tree")
if not setup then
return
end
nvimtree.setup({
sync_root_with_cwd = true,
view = {
width = 30,
},
git = {
ignore = false,
},
filters = {
dotfiles = false,
custom = {
"node_modules",
".git"
},
exclude = {
".gitignore"
}
},
})

View File

@@ -0,0 +1,29 @@
local setup, presence = pcall(require, "presence")
if not setup then
return
end
presence.setup({
auto_update = true,
neovim_image_text = "The One True Text Editor",
main_image = "neovim",
client_id = "793271441293967371",
log_level = info,
debounce_timeout = 10,
enable_line_number = false,
blacklist = {},
buttons = {
{ label = "Neovim", url = "https://github.com/neovim/neovim" },
{ label = "My config", url = "https://gitlab.com/taken-personal/neovim-config" },
},
file_assets = {},
show_time = true,
editing_text = "Editing %s",
file_explorer_text = "Browsing %s",
git_commit_text = "Committing changes",
plugin_manager_text = "Managing plugins",
reading_text = "Reading %s",
workspace_text = "Working on %s",
line_number_text = "Line %s out of %s",
})

View File

@@ -0,0 +1,51 @@
local telescope_setup, telescope = pcall(require, "telescope")
if not telescope_setup then
return
end
local builtin_setup, builtin = pcall(require, "telescope.builtin")
if not builtin_setup then
return
end
telescope.load_extension("project")
local findProject = require("telescope").extensions.project.project
local fileBrowser = require("telescope").extensions.file_browser.file_browser
telescope.setup({
extensions = {
project = {
sync_with_nvim_tree = true,
on_project_selected = function()
require("nvim-tree.api").tree.change_root(vim.fn.getcwd())
end,
},
file_browser = {
hidden = {
file_browser = true,
folder_browser = true,
},
},
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"
},
},
})
telescope.load_extension("file_browser")
telescope.load_extension("fzf")
vim.keymap.set("n", "<leader>ff", builtin.find_files, { desc = "Find files" })
vim.keymap.set("n", "<leader>fg", builtin.live_grep, { desc = "Live grep" })
vim.keymap.set("n", "<leader>fb", builtin.buffers, { desc = "Find buffers" })
vim.keymap.set("n", "<leader>fB", "<cmd>Telescope builtin<CR>", { desc = "Find buffers" })
vim.keymap.set("n", "<leader>fh", builtin.help_tags, { desc = "Help tags" })
vim.keymap.set("n", "<leader>fp", findProject, { desc = "Find projects" })
vim.keymap.set("n", "<leader>fd", fileBrowser, { desc = "File browser" })
vim.keymap.set("n", "<leader>fr", builtin.reloader, { desc = "Reload config" })
vim.keymap.set("n", "<leader>ht", builtin.colorscheme, { desc = "Colorscheme" })
vim.keymap.set("n", "<leader>fc", builtin.commands, { desc = "Commands" })

View File

@@ -0,0 +1,9 @@
local status, toggleterm = pcall(require, "toggleterm")
if not status then
return
end
toggleterm.setup {
shell = "pwsh.exe -nologo",
start_in_insert = true,
}

View File

@@ -0,0 +1,19 @@
local status, transparent = pcall(require, "transparent")
if not status then
return
end
transparent.setup({
groups = {
'Normal', 'NormalNC', 'Comment', 'Constant', 'Special', 'Identifier',
'Statement', 'PreProc', 'Type', 'Underlined', 'Todo', 'String', 'Function',
'Conditional', 'Repeat', 'Operator', 'Structure', 'LineNr', 'NonText',
'SignColumn', 'CursorLineNr', 'EndOfBuffer',
},
extra_groups = {
"NormalSB", "NvimTreeNormal", "NvimTreeNormalNC", "NvimTreeNormalSB",
"Folded", "NonText", "SpecialKey", "VertSplit", "EndOfBuffer", "SignColumn",
"BufferLineFill", "BufferLineBackground", "BufferLineBufferSelected",
},
exclude_groups = {},
})

View File

@@ -0,0 +1,15 @@
local status, treesitter = pcall(require, "nvim-treesitter.configs")
if not status then
return
end
treesitter.setup {
ensure_installed = { "lua", "vim", "vimdoc", "javascript", "java", "json" },
sync_install = false,
auto_install = true,
highlight = {
enable = true,
additional_vim_regex_highlighting = false,
},
}

View File

@@ -0,0 +1,47 @@
local status, whichkey = pcall(require, "which-key")
if not status then
return
end
whichkey.setup({
key_labels = {
["<leader>"] = "SPC",
["<space>"] = "SPC",
["<cr>"] = "RET",
["<Tab>"] = "TAB",
},
icons = {
breadcrumb = "»",
separator = "",
group = "",
}
})
whichkey.register({
["<leader>"] = {
w = {
name = "window",
},
f = {
name = "find",
},
b = {
name = "buffer",
},
g = {
name = "git",
},
p = {
name = "packer",
},
t = {
name = "toggle",
},
v = {
name = "lsp",
},
h = {
name = "theme",
},
},
})