add colorscheme and snippets

This commit is contained in:
Javier Pacheco 2023-08-16 05:31:28 -05:00
parent bc1a9e5d8f
commit b53aeb0f50
4 changed files with 136 additions and 48 deletions

View File

@ -448,6 +448,8 @@ local cmp = require 'cmp'
local lspkind = require('lspkind')
local luasnip = require 'luasnip'
require('luasnip.loaders.from_vscode').lazy_load()
-- load snippets from path/of/your/nvim/config/my-cool-snippets
require("luasnip.loaders.from_snipmate").lazy_load()
luasnip.config.setup {}
cmp.setup {

View File

@ -3,6 +3,25 @@
return {
-- [[ Eyecandy & fancy prgramming stuff ]]
-- [[ Colorscheme ]]
{
"navarasu/onedark.nvim",
config = function()
require('onedark').setup {
style = 'warm',
transparent = true,
code_style = {
comments = 'italic',
keywords = 'bold',
functions = 'italic',
strings = 'italic',
variables = 'bold'
},
}
require('onedark').load()
end
},
{
"folke/trouble.nvim",
dependencies = { "nvim-tree/nvim-web-devicons" },
@ -12,6 +31,47 @@ return {
{ 'matze/vim-move' },
{ "jbyuki/venn.nvim" },
{
"anuvyklack/hydra.nvim",
ft = { "markdown", "norg" },
config = function()
local Hydra = require('hydra')
local hint = [[
Arrow^^^^^^ Select region with <C-v>
^ ^ _K_ ^ ^ _f_: surround it with box
_H_ ^ ^ _L_
^ ^ _J_ ^ ^ _<Esc>_
]]
Hydra({
name = 'Draw Diagram',
hint = hint,
config = {
color = 'pink',
invoke_on_body = true,
hint = {
border = 'rounded'
},
on_enter = function()
vim.o.virtualedit = 'all'
end,
},
mode = 'n',
body = '<leader>d',
heads = {
{ 'H', '<C-v>h:VBox<CR>' },
{ 'J', '<C-v>j:VBox<CR>' },
{ 'K', '<C-v>k:VBox<CR>' },
{ 'L', '<C-v>l:VBox<CR>' },
{ 'f', ':VBox<CR>', { mode = 'v' } },
{ '<Esc>', nil, { exit = true } },
}
})
end
},
{
'windwp/nvim-autopairs',
config = function()
@ -53,13 +113,13 @@ return {
-- Preview in browser
{
"iamcco/markdown-preview.nvim",
ft = { "markdown" },
build = "cd app && npm install",
config = function()
vim.g.mkdp_filetypes = { "markdown" }
vim.g.mkdp_page_title = "${name}"
vim.g.mkdp_markdown_css = vim.fn.stdpath("config") .. "/assets/markdown.css"
end,
ft = { "markdown" },
},
-- Table mode
@ -80,32 +140,6 @@ return {
},
-- [[ notes ]]
-- {
-- 'jakewvincent/mkdnflow.nvim',
-- rocks = 'luautf8', -- Ensures optional luautf8 dependency is installed
-- dependencies = { 'jubnzv/mdeval.nvim' },
-- config = function()
-- require('mkdnflow').setup({
-- links = {
-- style = 'markdown',
-- name_is_source = false,
-- conceal = true,
-- context = 0,
-- implicit_extension = nil,
-- transform_implicit = false,
-- transform_explicit = function(text)
-- text = text:gsub(" ", "-")
-- text = text:lower()
-- text = os.date('%Y-%m-%d_') .. text
-- return (text)
-- end
-- },
-- mappings = {
-- MkdnToggleToDo = { { 'n', 'v' }, '<leader>td' },
-- }
-- })
-- end
-- },
{
'AntonVanAssche/md-headers.nvim',
dependencies = {
@ -134,6 +168,32 @@ return {
heading = {
icons = { "", "", "", "", "", "", },
},
todo = {
cancelled = {
icon = "",
},
done = {
icon = "",
},
on_hold = {
icon = "",
},
recurring = {
icon = "",
},
uncertain = {
icon = "",
},
pending = {
icon = "",
},
undone = {
icon = " ",
},
urgent = {
icon = "!",
},
},
},
},
}, -- Adds pretty icons to your documents
@ -206,6 +266,7 @@ return {
require("nvim-tree").setup {}
end,
},
{
"https://git.sr.ht/~whynothugo/lsp_lines.nvim",
config = function()
@ -215,6 +276,7 @@ return {
{
'Exafunction/codeium.vim',
ft = { "python", "lua", "rust" },
config = function()
-- Change '<C-g>' here to any keycode you like.
vim.keymap.set('i', '<c-a>', function() return vim.fn['codeium#Accept']() end, { expr = true })
@ -224,30 +286,25 @@ return {
end
},
{
'dhruvasagar/vim-table-mode'
},
-- [[ ChatGPT]]
{
"jackMort/ChatGPT.nvim",
event = "VeryLazy",
config = function()
require("chatgpt").setup({
api_key_cmd = "",
-- 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
})
end,
dependencies = {
"MunifTanjim/nui.nvim",
"nvim-lua/plenary.nvim",
"nvim-telescope/telescope.nvim"
}
},
-- {
-- "jackMort/ChatGPT.nvim",
-- event = "VeryLazy",
-- config = function()
-- require("chatgpt").setup({
-- })
-- end,
-- dependencies = {
-- "MunifTanjim/nui.nvim",
-- "nvim-lua/plenary.nvim",
-- "nvim-telescope/telescope.nvim"
-- }
-- },
-- [[ Rust Baby!! ]]
{
'simrat39/rust-tools.nvim',
ft = { "rust" },
config = function()
local rt = require("rust-tools")
local mason_registry = require("mason-registry")

View File

@ -32,8 +32,6 @@ vim.opt.showmode = false
-- Set colorscheme
vim.o.termguicolors = true
vim.g.forestbones = { transparent_background = true, }
vim.cmd [[colorscheme gruvbones]]
local map = vim.api.nvim_set_keymap
local opts = { noremap = true, silent = true }
@ -211,3 +209,26 @@ vim.api.nvim_create_autocmd("QuitPre", {
end
end
})
-- [[ Venn.nvim ]]
function _G.Toggle_venn()
local venn_enabled = vim.inspect(vim.b.venn_enabled)
if venn_enabled == "nil" then
vim.b.venn_enabled = true
vim.cmd [[setlocal ve=all]]
-- draw a line on HJKL keystokes
vim.api.nvim_buf_set_keymap(0, "n", "J", "<C-v>j:VBox<CR>", { noremap = true })
vim.api.nvim_buf_set_keymap(0, "n", "K", "<C-v>k:VBox<CR>", { noremap = true })
vim.api.nvim_buf_set_keymap(0, "n", "L", "<C-v>l:VBox<CR>", { noremap = true })
vim.api.nvim_buf_set_keymap(0, "n", "H", "<C-v>h:VBox<CR>", { noremap = true })
-- draw a box by pressing "f" with visual selection
vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox<CR>", { noremap = true })
else
vim.cmd [[setlocal ve=]]
vim.cmd [[mapclear <buffer>]]
vim.b.venn_enabled = nil
end
end
-- toggle keymappings for venn using <leader>v
vim.api.nvim_set_keymap('n', '<leader>v', ":lua Toggle_venn()<CR>", { noremap = true })

8
snippets/norg.snippets Normal file
View File

@ -0,0 +1,8 @@
# My persoal useful snippets.
# [[ Neorg ]]
snippet lk
{:${1:Object}:}[${2:Description}]
snippet lf
{file:///${1:some/path/}:}[${2:Description}]