Compare commits
No commits in common. "d2309ca00ad0a6cc77ad2354547f6f81a1e0026e" and "24dfc6a297eb30530166970f91907fab7bfb7bfd" have entirely different histories.
d2309ca00a
...
24dfc6a297
8 changed files with 15 additions and 146 deletions
|
|
@ -1,46 +1,14 @@
|
|||
local ls = require('luasnip')
|
||||
local ll = require('luasnip.loaders.from_lua')
|
||||
local types = require('luasnip.util.types')
|
||||
|
||||
ls.config.set_config({
|
||||
require('luasnip').config.set_config({
|
||||
enable_autosnippets = true,
|
||||
store_selection_keys = '<C-s>',
|
||||
history = true,
|
||||
updateevents = 'TextChanged,TextChangedI',
|
||||
delete_check_events = 'TextChanged',
|
||||
ext_opts = {
|
||||
[types.insertNode] = {
|
||||
active = {},
|
||||
unvisited = {
|
||||
virt_text = { { '<- insert', 'DiagnosticVirtualTextHint' } }
|
||||
},
|
||||
visited = {},
|
||||
passive = {},
|
||||
snippet_passive = {},
|
||||
},
|
||||
[types.choiceNode] = {
|
||||
active = {
|
||||
virt_text = { { '<- insert', 'DiagnosticVirtualTextError' } },
|
||||
},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
ll.load({ paths = { vim.fn.stdpath('config') .. '/snippets' } })
|
||||
require('luasnip.loaders.from_lua').load({ paths = { vim.fn.stdpath('config') .. '/snippets' } })
|
||||
|
||||
vim.keymap.set({ 'i', 's' }, '<C-j>', function()
|
||||
if ls.expand_or_jumpable() then
|
||||
ls.expand_or_jump()
|
||||
end
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set({ 'i', 's' }, '<C-k>', function()
|
||||
if ls.jumpable(-1) then
|
||||
ls.jump(-1)
|
||||
end
|
||||
end, { silent = true })
|
||||
|
||||
vim.keymap.set('n', '<leader><leader>s', function()
|
||||
vim.cmd('source ' .. vim.fn.stdpath('config') .. '/after/plugin/luasnip.lua')
|
||||
vim.notify('Sourced snippets', 'info', { title = 'LuaSnip' })
|
||||
end)
|
||||
local keymap = vim.api.nvim_set_keymap
|
||||
local opts = { noremap = true, silent = true }
|
||||
keymap('i', '<C-j>', '<cmd>lua require("luasnip").jump(1)<cr>', opts)
|
||||
keymap('i', '<C-k>', '<cmd>lua require("luasnip").jump(-1)<cr>', opts)
|
||||
|
|
|
|||
|
|
@ -42,11 +42,6 @@ local function quickfix()
|
|||
end
|
||||
vim.keymap.set('n', '<leader>qf', quickfix)
|
||||
|
||||
vim.keymap.set('v', '<leader>dgh', "<cmd>diffget LOCAL<cr>")
|
||||
vim.keymap.set('v', '<leader>dgl', "<cmd>diffget REMOTE<cr>")
|
||||
|
||||
vim.keymap.set('n', '<leader>dgh', "<cmd>diffget LOCAL<cr>")
|
||||
vim.keymap.set('n', '<leader>dgl', "<cmd>diffget REMOTE<cr>")
|
||||
|
||||
-- stay in visual mode after indenting/dedenting
|
||||
vim.keymap.set('v', '<', '<gv')
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
-- vim.opt.guicursor = ''
|
||||
vim.notify = require('notify')
|
||||
|
||||
-- line numbers
|
||||
vim.opt.nu = true
|
||||
|
|
@ -31,14 +30,3 @@ vim.opt.scrolloff = 8
|
|||
vim.opt.signcolumn = 'yes'
|
||||
vim.opt.updatetime = 500
|
||||
vim.opt.colorcolumn = '80'
|
||||
|
||||
vim.api.nvim_create_autocmd('BufReadPost', {
|
||||
callback = function(args)
|
||||
local valid_line = vim.fn.line([['"]]) >= 1 and vim.fn.line([['"]]) < vim.fn.line('$')
|
||||
local not_commit = vim.b[args.buf].filetype ~= 'commit'
|
||||
|
||||
if valid_line and not_commit then
|
||||
vim.cmd([[normal! g`"]])
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -1,13 +0,0 @@
|
|||
return {
|
||||
'catppuccin/nvim',
|
||||
name = 'catppuccin',
|
||||
priority = 1000,
|
||||
config = function()
|
||||
local catpuccin = require('catppuccin')
|
||||
catpuccin.setup({
|
||||
flavour = 'frappe',
|
||||
styles = {
|
||||
},
|
||||
})
|
||||
end
|
||||
}
|
||||
|
|
@ -5,7 +5,6 @@ return {
|
|||
hasfile = vim.fn.stdpath('data') .. '/config-local',
|
||||
autocommands_create = true,
|
||||
commands_create = true,
|
||||
lookup_parents = true,
|
||||
silent = false,
|
||||
lookup_parents = false,
|
||||
},
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,6 +12,11 @@ return {
|
|||
dependencies = {
|
||||
{ 'nvim-lua/plenary.nvim' } }
|
||||
},
|
||||
{
|
||||
'catppuccin/nvim',
|
||||
name = 'catppuccin',
|
||||
priority = 1000
|
||||
},
|
||||
{
|
||||
'tpope/vim-fugitive',
|
||||
name = 'fugitive'
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ local handlers = {
|
|||
require('lspconfig').ruff_lsp.setup({
|
||||
on_attach = function(client, bufnr)
|
||||
client.server_capabilities.hoverProvider = false
|
||||
client.server_capabilities.documentFormattingProvider = false
|
||||
client.server_capabilities.documentFormattingProver = false
|
||||
end,
|
||||
})
|
||||
end,
|
||||
|
|
@ -70,7 +70,7 @@ local handlers = {
|
|||
settings = {
|
||||
texlab = {
|
||||
build = {
|
||||
onSave = false,
|
||||
onSave = true,
|
||||
forwardSearchAfter = true,
|
||||
},
|
||||
chktex = {
|
||||
|
|
@ -110,7 +110,7 @@ return {
|
|||
opts = {
|
||||
handlers = handlers,
|
||||
ensure_installed = {
|
||||
'lua_ls', 'clangd', 'pylsp', 'yamlls', 'esbonio', 'ruff_lsp', 'lemminx',
|
||||
'lua_ls', 'clangd', 'pylsp', 'yamlls', 'esbonio', 'ruff_lsp',
|
||||
},
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -1,73 +0,0 @@
|
|||
local ls = require('luasnip')
|
||||
local s = ls.snippet
|
||||
local sn = ls.snippet_node
|
||||
local t = ls.text_node
|
||||
local i = ls.insert_node
|
||||
local f = ls.function_node
|
||||
local d = ls.dynamic_node
|
||||
local fmt = require('luasnip.extras.fmt').fmt
|
||||
local fmta = require('luasnip.extras.fmt').fmta
|
||||
local rep = require('luasnip.extras').rep
|
||||
|
||||
return {
|
||||
s(
|
||||
{
|
||||
trig = 'console',
|
||||
name = 'Console Code-Block',
|
||||
dscr = 'Creates a console code block'
|
||||
},
|
||||
fmta(
|
||||
[[
|
||||
.. code-block:: console
|
||||
|
||||
$ <>
|
||||
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
}
|
||||
)
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = 'shell',
|
||||
name = 'Shell Code-Block',
|
||||
dscr = 'Create a shell code block'
|
||||
},
|
||||
fmta(
|
||||
[[
|
||||
.. code-block:: sh
|
||||
<>
|
||||
|
||||
<>
|
||||
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
}
|
||||
)
|
||||
),
|
||||
s(
|
||||
{
|
||||
trig = 'python',
|
||||
name = 'Python Code-Block',
|
||||
dscr = 'Create python code block',
|
||||
},
|
||||
fmta(
|
||||
[[
|
||||
.. code-block:: python
|
||||
:linenos:
|
||||
:caption: <>
|
||||
:emphasize-lines: <>
|
||||
|
||||
<>
|
||||
]],
|
||||
{
|
||||
i(1),
|
||||
i(2),
|
||||
i(3),
|
||||
}
|
||||
)
|
||||
),
|
||||
}
|
||||
Loading…
Reference in a new issue