You've already forked dotfiles
Moving all the nvim files to a subdirectory and updated the deploy script.
This commit is contained in:
16
nvim/lua/plugins/comment.lua
Normal file
16
nvim/lua/plugins/comment.lua
Normal file
@@ -0,0 +1,16 @@
|
||||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
config = function()
|
||||
require('Comment').setup {
|
||||
ignore = '^$',
|
||||
toggler = {
|
||||
line = 'gc',
|
||||
block = '<nop>',
|
||||
},
|
||||
}
|
||||
end,
|
||||
keys = {
|
||||
{ '<leader>c', ':norm gcc<CR>' },
|
||||
{ '<leader>c', ':norm gc<CR>', mode = 'v' },
|
||||
}
|
||||
}
|
||||
7
nvim/lua/plugins/floaterm.lua
Normal file
7
nvim/lua/plugins/floaterm.lua
Normal file
@@ -0,0 +1,7 @@
|
||||
return {
|
||||
'voldikss/vim-floaterm',
|
||||
keys = {
|
||||
{ 't', ':FloatermToggle myfloat<CR>' },
|
||||
{ '<ESC>', '<C-\\><C-n>:q<CR>', mode = 't' },
|
||||
},
|
||||
}
|
||||
11
nvim/lua/plugins/gruvbox.lua
Normal file
11
nvim/lua/plugins/gruvbox.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
return {
|
||||
'ellisonleao/gruvbox.nvim',
|
||||
config = function()
|
||||
require('gruvbox').setup({
|
||||
contrast = 'hard',
|
||||
})
|
||||
vim.cmd([[colorscheme gruvbox]])
|
||||
end,
|
||||
lazy = false,
|
||||
priority = 1000,
|
||||
}
|
||||
4
nvim/lua/plugins/lspconfig.lua
Normal file
4
nvim/lua/plugins/lspconfig.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
'neovim/nvim-lspconfig',
|
||||
lazy = false,
|
||||
}
|
||||
18
nvim/lua/plugins/lualine.lua
Normal file
18
nvim/lua/plugins/lualine.lua
Normal file
@@ -0,0 +1,18 @@
|
||||
return {
|
||||
'nvim-lualine/lualine.nvim',
|
||||
config = function()
|
||||
require('lualine').setup {
|
||||
tabline = {
|
||||
lualine_a = {
|
||||
'tabs',
|
||||
},
|
||||
lualine_z = {
|
||||
'buffers',
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-tree/nvim-web-devicons'
|
||||
},
|
||||
}
|
||||
10
nvim/lua/plugins/luasnip.lua
Normal file
10
nvim/lua/plugins/luasnip.lua
Normal file
@@ -0,0 +1,10 @@
|
||||
return {
|
||||
'L3MON4D3/LuaSnip',
|
||||
config = function()
|
||||
require('luasnip.loaders.from_vscode').lazy_load()
|
||||
end,
|
||||
dependencies = {
|
||||
'saadparwaiz1/cmp_luasnip', -- Wrapper to load snippets in nvim-cmp
|
||||
'rafamadriz/friendly-snippets',
|
||||
},
|
||||
}
|
||||
95
nvim/lua/plugins/mason.lua
Normal file
95
nvim/lua/plugins/mason.lua
Normal file
@@ -0,0 +1,95 @@
|
||||
return {
|
||||
'williamboman/mason.nvim',
|
||||
config = function()
|
||||
require('mason').setup()
|
||||
|
||||
local mason_lspconfig = require('mason-lspconfig')
|
||||
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||
|
||||
-- All functions and keymaps contained here are universal to LSPs
|
||||
local on_attach = function(client, bufnr)
|
||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||
|
||||
-- Keyboard Mappings
|
||||
local bufopts = { noremap = true, silent = true, buffer = bufnr }
|
||||
vim.keymap.set('n', '<c-[>', vim.diagnostic.goto_prev, bufopts)
|
||||
vim.keymap.set('n', '<c-]>', vim.diagnostic.goto_next, bufopts)
|
||||
-- vim.keymap.set('n', 'gl', vim.diagnostic.open_float, bufopts)
|
||||
vim.keymap.set('n', 'ga', vim.lsp.buf.code_action, bufopts)
|
||||
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', 'gs', vim.lsp.buf.signature_help, bufopts)
|
||||
vim.keymap.set('n', '<leader>D', vim.lsp.buf.type_definition, bufopts)
|
||||
-- vim.keymap.set('n', '<leader>rn', vim.lsp.buf.rename, bufopts)
|
||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||
vim.keymap.set('n', '<leader><leader>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||
|
||||
-- DAP debug
|
||||
-- if dap then
|
||||
-- vim.keymap.set('n', '<F5>', function() dap.continue() end, bufopts)
|
||||
-- vim.keymap.set('n', '<F10>', function() dap.step_over() end, bufopts)
|
||||
-- vim.keymap.set('n', '<F11>', function() dap.step_into() end, bufopts)
|
||||
-- vim.keymap.set('n', '<F12>', function() dap.step_out() end, bufopts)
|
||||
-- vim.keymap.set('n', '<leader>b', function() dap.toggle_breakpoint() end, bufopts)
|
||||
-- end
|
||||
end
|
||||
|
||||
mason_lspconfig.setup {
|
||||
automatic_installation = true,
|
||||
}
|
||||
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
mason_lspconfig.setup_handlers {
|
||||
function(server_name)
|
||||
lspconfig[server_name].setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach
|
||||
}
|
||||
end,
|
||||
|
||||
['rust_analyzer'] = function()
|
||||
lspconfig.rust_analyzer.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
['rust-analyzer'] = {
|
||||
checkOnSave = true,
|
||||
check = {
|
||||
command = 'clippy',
|
||||
extraArgs = { '--', '-Dclippy::all', '-Wclippy::pedantic' },
|
||||
},
|
||||
diagnostics = {
|
||||
enable = true,
|
||||
experimental = {
|
||||
enable = true,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
|
||||
['lua_ls'] = function()
|
||||
lspconfig.lua_ls.setup {
|
||||
capabilities = capabilities,
|
||||
on_attach = on_attach,
|
||||
settings = {
|
||||
Lua = {
|
||||
diagnostics = {
|
||||
globals = { 'vim' }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
end,
|
||||
}
|
||||
end,
|
||||
dependencies = {
|
||||
'williamboman/mason-lspconfig.nvim'
|
||||
},
|
||||
}
|
||||
90
nvim/lua/plugins/nvim-cmp.lua
Normal file
90
nvim/lua/plugins/nvim-cmp.lua
Normal file
@@ -0,0 +1,90 @@
|
||||
return {
|
||||
'hrsh7th/nvim-cmp',
|
||||
config = function()
|
||||
local cmp = require('cmp')
|
||||
cmp.setup {
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
completion = {
|
||||
completeopt = 'menu,menuone,noinsert',
|
||||
},
|
||||
experimental = {
|
||||
ghost_text = true,
|
||||
},
|
||||
mapping = {
|
||||
['<c-n>'] = cmp.mapping.select_next_item(),
|
||||
['<c-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<c-j>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<c-k>'] = cmp.mapping.scroll_docs(4),
|
||||
['<c-space>'] = cmp.mapping.complete(),
|
||||
['<c-y>'] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
}),
|
||||
},
|
||||
formatting = {
|
||||
format = function(entry, vim_item)
|
||||
vim_item.menu = ({
|
||||
buffer = '[Buf]',
|
||||
luasnip = '[Snips]',
|
||||
nvim_lsp = '[LSP]',
|
||||
nvim_lua = '[Lua]',
|
||||
})[entry.source.name]
|
||||
return vim_item
|
||||
end,
|
||||
field = { 'abbr', 'kind', 'menu' }
|
||||
},
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
{ name = 'path' },
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
}
|
||||
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' },
|
||||
{ name = 'buffer' },
|
||||
}, {
|
||||
{ name = 'cmdline' },
|
||||
})
|
||||
})
|
||||
|
||||
cmp.setup.cmdline({ '/', '?' }, {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
end,
|
||||
dependencies = {
|
||||
{
|
||||
'hrsh7th/cmp-nvim-lsp',
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
'hrsh7th/cmp-buffer',
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
'hrsh7th/cmp-path',
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
'hrsh7th/cmp-cmdline',
|
||||
lazy = false,
|
||||
},
|
||||
{
|
||||
'L3MON4D3/LuaSnip',
|
||||
lazy = false,
|
||||
},
|
||||
},
|
||||
event = 'InsertEnter',
|
||||
lazy = false,
|
||||
}
|
||||
30
nvim/lua/plugins/telekasten.lua
Normal file
30
nvim/lua/plugins/telekasten.lua
Normal file
@@ -0,0 +1,30 @@
|
||||
return {
|
||||
'renerocksai/telekasten.nvim',
|
||||
config = function()
|
||||
local home = vim.fn.expand('~/.zettelkasten')
|
||||
require('telekasten').setup({
|
||||
home = home,
|
||||
dailies = home .. '/' .. 'daily',
|
||||
weeklies = home .. '/' .. 'weeklies',
|
||||
templates = home .. '/' .. 'templates',
|
||||
template_new_note = home .. '/' .. 'templates/new_note.md',
|
||||
template_new_daily = home .. '/' .. 'templates/daily.md',
|
||||
template_new_weekly = home .. '/' .. 'templates/weekly.md',
|
||||
command_palette_theme = 'ivy',
|
||||
show_tags_theme = 'get_cursor',
|
||||
plug_into_calendar = false,
|
||||
|
||||
})
|
||||
|
||||
-- Color for telekasten syntax
|
||||
vim.api.nvim_set_hl(0, 'tkLink', { ctermfg = 72, cterm = { bold = true, underdouble = true }, fg = '#689d6a', bold = true, underdouble = true })
|
||||
vim.api.nvim_set_hl(0, 'tkBrackets', { ctermfg = 'gray', fg = 'gray' })
|
||||
vim.api.nvim_set_hl(0, 'tkTag', { ctermfg = 'gray', fg = 'gray' })
|
||||
end,
|
||||
keys = {
|
||||
{ '<leader>zp', ':Telekasten panel<CR>' },
|
||||
{ '<leader>zn', ':Telekasten find_notes<CR>' },
|
||||
{ '<leader>zt', ':Telekasten show_tags<CR>' },
|
||||
},
|
||||
-- lazy = false
|
||||
}
|
||||
46
nvim/lua/plugins/telescope.lua
Normal file
46
nvim/lua/plugins/telescope.lua
Normal file
@@ -0,0 +1,46 @@
|
||||
return {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
config = function()
|
||||
local actions = require('telescope.actions')
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
file_ignore_patterns = {
|
||||
'.png$',
|
||||
'.jpg$',
|
||||
'.jpeg$',
|
||||
'.ico$',
|
||||
'.icns$',
|
||||
'.webp$',
|
||||
'.uproject$',
|
||||
'-workspace$',
|
||||
},
|
||||
-- layout_strategy = 'vertical',
|
||||
-- layout_config = {
|
||||
-- height = 0.0
|
||||
-- },
|
||||
results_title = false,
|
||||
prompt_prefix = ' ',
|
||||
selection_caret = '➤ ',
|
||||
mappings = {
|
||||
i = {
|
||||
['<ESC>'] = actions.close
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
end,
|
||||
dependencies = {
|
||||
'nvim-lua/plenary.nvim'
|
||||
},
|
||||
keys = {
|
||||
{ '<leader>ff', '<cmd>Telescope find_files<CR>' },
|
||||
{ '<leader>fg', '<cmd>Telescope git_commits<CR>' },
|
||||
{ '<leader>fh', '<cmd>Telescope help_tags<CR>' },
|
||||
{ '<leader>fr', '<cmd>Telescope live_grep<CR>' },
|
||||
{ '<leader>fm', '<cmd>Telescope marks<CR>' },
|
||||
{ '<leader>fb', '<cmd>Telescope buffers<CR>' },
|
||||
{ '<leader>fd', '<cmd>Telescope diagnostics<CR>' },
|
||||
{ '<leader>fs', '<cmd>Telescope lsp_document_symbols<CR>' },
|
||||
{ '<leader>fw', '<cmd>Telescope lsp_dynamic_workspace_symbols<CR>' },
|
||||
},
|
||||
}
|
||||
45
nvim/lua/plugins/treesitter.lua
Normal file
45
nvim/lua/plugins/treesitter.lua
Normal file
@@ -0,0 +1,45 @@
|
||||
return {
|
||||
'nvim-treesitter/nvim-treesitter',
|
||||
build = function()
|
||||
require('nvim-treesitter.install').update({ with_sync = true })
|
||||
end,
|
||||
config = function()
|
||||
require('nvim-treesitter.configs').setup {
|
||||
auto_install = true,
|
||||
ensure_installed = {
|
||||
'c',
|
||||
'c_sharp',
|
||||
'comment',
|
||||
'css',
|
||||
'html',
|
||||
'java',
|
||||
'javascript',
|
||||
'json',
|
||||
'lua',
|
||||
'python',
|
||||
'query',
|
||||
'rust',
|
||||
'toml',
|
||||
'tsx',
|
||||
'typescript',
|
||||
'yaml',
|
||||
},
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
},
|
||||
indent = {
|
||||
enable = true,
|
||||
},
|
||||
rainbow = {
|
||||
enable = true,
|
||||
}
|
||||
}
|
||||
-- require('nvim-treesitter.install').prefer_git = true
|
||||
-- TSUpdate
|
||||
end,
|
||||
lazy = false,
|
||||
}
|
||||
3
nvim/lua/plugins/vim-gitgutter.lua
Normal file
3
nvim/lua/plugins/vim-gitgutter.lua
Normal file
@@ -0,0 +1,3 @@
|
||||
return {
|
||||
'airblade/vim-gitgutter'
|
||||
}
|
||||
4
nvim/lua/plugins/vim-godot.lua
Normal file
4
nvim/lua/plugins/vim-godot.lua
Normal file
@@ -0,0 +1,4 @@
|
||||
return {
|
||||
'habamax/vim-godot',
|
||||
ft = 'gdscript',
|
||||
}
|
||||
Reference in New Issue
Block a user