dotfiles
bugabingas dorkfiles
owned by bugabinga
neovim: fix tab key and bad terminal mapping
5639c19fc6d32e1891c4039d9f58a502e429240f
Oliver Jan Krylow <oliver@bugabinga.net> ·
unsigned
Browse filesCompare with HEAD
Changed files (4)
41 +* make highlights more visible when expanding snippets
41 42 * toggling case conventions
42 43 * Move to treesitter main branch
43 44 * check out `vim.snippet`
neovim/lazy-lock.json
Modified42 42 "nvim-gomove": {
"branch":
"main",
"commit":
"2b44ae7ac0804f4e3959228122f7c85bef1964e3" },
43 43 "nvim-jdtls": {
"branch":
"master",
"commit":
"a4746791876166dc146eae573a1b49d24a6652e7" },
44 44 "nvim-lastplace": {
"branch":
"main",
"commit":
"0bb6103c506315044872e0f84b1f736c4172bb20" },
45 - "nvim-lint": {
"branch":
"master",
"commit":
"3317b73ec3eb76cd8ca83e05880c07c83e368c1e" },
45 + "nvim-lint": {
"branch":
"master",
"commit":
"4055dc856d5ac8f6b85748006fd8fa6457e086e8" },
46 46 "nvim-lsp-file-operations": {
"branch":
"master",
"commit":
"223aca86b737dc66e9c51ebcda8788a8d9cc6cf2" },
47 47 "nvim-navbuddy": {
"branch":
"master",
"commit":
"f34237e8a41ebc6e2716af2ebf49854d8c5289c8" },
48 48 "nvim-navic": {
"branch":
"master",
"commit":
"8649f694d3e76ee10c19255dece6411c29206a54" },
51 51 "nvim-spectre": {
"branch":
"master",
"commit":
"2b012554a2536465243c0dff3605b5927c49ed23" },
52 52 "nvim-surround": {
"branch":
"main",
"commit":
"84a26afce16cffa7e3322cfa80a42cddf60616eb" },
53 53 "nvim-tree.lua": {
"branch":
"master",
"commit":
"ddd1d6eb21c45433bdc65cc8015f2457998f2bf2" },
54 - "nvim-treesitter": {
"branch":
"master",
"commit":
"e9321bb914b3a5a88b7dff5392f0f5f8d83bee67" },
54 + "nvim-treesitter": {
"branch":
"master",
"commit":
"2bad828b48aed74efe8f7e4ea15550e18c7b482d" },
55 55 "nvim-treesitter-endwise": {
"branch":
"master",
"commit":
"60e8c288e011403f248b5f6478dde12bed8a6c55" },
56 - "nvim-treesitter-textobjects": {
"branch":
"master",
"commit":
"2aa454e4037424c678a8ff033951a5be39e54b9c" },
56 + "nvim-treesitter-textobjects": {
"branch":
"master",
"commit":
"252e65409bc783b0d154f3a341e423c2c4475b26" },
57 57 "nvim-ts-autotag": {
"branch":
"main",
"commit":
"531f48334c422222aebc888fd36e7d109cb354cd" },
58 58 "nvim-ts-context-commentstring": {
"branch":
"main",
"commit":
"734ebad31c81c6198dfe102aa23280937c937c42" },
59 - "nvim-web-devicons": {
"branch":
"master",
"commit":
"fd4abfc5237246670977972c6f518186b621a32d" },
59 + "nvim-web-devicons": {
"branch":
"master",
"commit":
"6e355632387a085f15a66ad68cf681c1d7374a04" },
60 60 "nvim-window": {
"branch":
"main",
"commit":
"fad0dc96de265b0bdcb21d1071329e5ab1deb4af" },
61 61 "oil.nvim": {
"branch":
"master",
"commit":
"e462a3446505185adf063566f5007771b69027a1" },
62 62 "overseer.nvim": {
"branch":
"master",
"commit":
"b04b0b105c07b4f02b3073ea3a98d6eca90bf152" },
65 65 "plenary.nvim": {
"branch":
"master",
"commit":
"50012918b2fc8357b87cff2a7f7f0446e47da174" },
66 66 "qf_helper.nvim": {
"branch":
"master",
"commit":
"91dad029c11d1c39b0d1276eda52616f651072be" },
67 67 "resession.nvim": {
"branch":
"master",
"commit":
"dc8825439c619030925543a444c4186a2487c200" },
68 - "schemastore.nvim": {
"branch":
"main",
"commit":
"80d701841487f72bf9d3fa56b25146b95e190502" },
68 + "schemastore.nvim": {
"branch":
"main",
"commit":
"c5d5abc86910fb31b9f734cae2547322e81d3a26" },
69 69 "specs.nvim": {
"branch":
"main",
"commit":
"e929006d3f6bb8e43f03e13ac364c67236eb5299" },
70 70 "speedtyper.nvim": {
"branch":
"main",
"commit":
"2d158eed4c753995b0501a3a7a72464fbb213e3d" },
71 71 "ssr.nvim": {
"branch":
"main",
"commit":
"bb323ba621ac647b4ac5638b47666e3ef3c279e1" },
neovim/lua/bugabinga/plugins/cmp.lua
Modified 1 -local map
= require 'std.map' 2 -local user_command
= require 'std.user_command' 3 1 local icon
= require 'std.icon' 9 - 'hrsh7th/cmp-nvim-lsp',
10 - 'hrsh7th/cmp-buffer',
12 - 'hrsh7th/cmp-nvim-lua',
13 - 'saadparwaiz1/cmp_luasnip',
14 - 'onsails/lspkind.nvim',
17 - config =
function ()
18 - local cmp
= require 'cmp' 19 - local luasnip
= require 'luasnip' 20 - local MAX_INDEX_FILE_SIZE
= 4000 7 + 'hrsh7th/cmp-nvim-lsp',
8 + 'hrsh7th/cmp-buffer',
10 + 'hrsh7th/cmp-nvim-lua',
11 + 'saadparwaiz1/cmp_luasnip',
12 + 'onsails/lspkind.nvim',
15 + config =
function ()
16 + local cmp
= require 'cmp' 17 + local luasnip
= require 'luasnip' 18 + local MAX_INDEX_FILE_SIZE
= 4000 22 - local has_words_before = function ()
23 - local line, col
= unpack( vim.api.nvim_win_get_cursor(
0 ) )
24 - return col
~= 0 and vim.api.nvim_buf_get_lines(
0, line
- 1, line,
true )[
1]:sub( col, col ):match
'%s' == nil 20 + local snippet_next = function ( fallback )
21 + if luasnip.expand_or_jumpable()
then 22 + luasnip.expand_or_jump()
23 + elseif cmp.visible()
then 24 + cmp.select_next_item()
27 - local snippet_next = function ( fallback )
28 - if luasnip.expand_or_jumpable()
then 29 - luasnip.expand_or_jump()
30 - elseif cmp.visible()
then 31 - cmp.select_next_item()
32 - elseif has_words_before()
then 30 + local snippet_prev = function ( fallback )
31 + if luasnip.jumpable(
-1 )
then 33 + elseif cmp.visible()
then 34 + cmp.select_prev_item()
39 - local snippet_prev = function ( fallback )
40 - if luasnip.jumpable(
-1 )
then 42 - elseif cmp.visible()
then 43 - cmp.select_prev_item()
40 + local mapping
= cmp.mapping.preset.insert {
41 + [
'<C-d>'] = cmp.mapping.scroll_docs(
-4 ),
42 + [
'<C-f>'] = cmp.mapping.scroll_docs(
4 ),
43 + [
'<C-e>'] = cmp.mapping.close(),
44 + [
'<C-y>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select =
true, },
45 + [
'<C-space>'] = cmp.mapping.complete(),
46 + [
'<Tab>'] = cmp.mapping( snippet_next, {
'i',
's', } ),
47 + [
'<S-Tab>'] = cmp.mapping( snippet_prev, {
'i',
's', } ),
49 - local mapping
= cmp.mapping.preset.insert {
50 - [
'<C-d>'] = cmp.mapping.scroll_docs(
-4 ),
51 - [
'<C-f>'] = cmp.mapping.scroll_docs(
4 ),
52 - [
'<C-e>'] = cmp.mapping.close(),
53 - [
'<C-y>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace,
select =
true, },
54 - [
'<C-space>'] = cmp.mapping.complete(),
55 - [
'<Tab>'] = cmp.mapping( snippet_next, {
'i',
's', } ),
56 - [
'<S-Tab>'] = cmp.mapping( snippet_prev, {
'i',
's', } ),
50 + local formatting
= {}
51 + local ok, lspkind
= pcall(
require,
'lspkind' )
53 + formatting.format
= lspkind.cmp_format {
56 + Copilot = icon.copilot,
59 + Constant = icon.constant,
60 + Constructor = icon.constructor,
62 + EnumMember = icon.enum_member,
66 + Folder = icon.folder,
67 + Function = icon[
'function'],
68 + Interface = icon.interface,
69 + Keyword = icon.keyword,
70 + Method = icon.method,
71 + Module = icon.module,
72 + Operator = icon.operator,
73 + Property = icon.property,
74 + Reference = icon.reference,
75 + Snippet = icon.snippet,
76 + Struct = icon.struct,
78 + TypeParameter = icon.type_parameter,
81 + Variable = icon.variable,
86 + nvim_lua =
'[nvim]',
60 - local formatting
= {}
61 - local ok, lspkind
= pcall(
require,
'lspkind' )
63 - formatting.format
= lspkind.cmp_format {
66 - Copilot = icon.copilot,
69 - Constant = icon.constant,
70 - Constructor = icon.constructor,
72 - EnumMember = icon.enum_member,
76 - Folder = icon.folder,
77 - Function = icon[
'function'],
78 - Interface = icon.interface,
79 - Keyword = icon.keyword,
80 - Method = icon.method,
81 - Module = icon.module,
82 - Operator = icon.operator,
83 - Property = icon.property,
84 - Reference = icon.reference,
85 - Snippet = icon.snippet,
86 - Struct = icon.struct,
88 - TypeParameter = icon.type_parameter,
91 - Variable = icon.variable,
96 - nvim_lua =
'[nvim]',
94 + {
name =
'neodev', },
95 + {
name =
'nvim_lua', },
96 + {
name =
'nvim_lsp', },
98 + {
name =
'luasnip', },
99 + {
name =
'neorg', },
102 + keyword_length =
4,
104 + get_bufnrs =
function ()
106 + for _, bufnr
in ipairs( vim.api.nvim_list_bufs() )
do 108 + if vim.api.nvim_buf_is_loaded( bufnr )
and vim.api.nvim_buf_line_count( bufnr )
< MAX_INDEX_FILE_SIZE
then 109 + table.
insert( bufs, bufnr )
104 - {
name =
'nvim_lua', },
105 - {
name =
'nvim_lsp', },
106 - {
name =
'path', },
107 - {
name =
'luasnip', },
108 - {
name =
'neorg', },
111 - keyword_length =
4,
113 - get_bufnrs =
function ()
115 - for _, bufnr
in ipairs( vim.api.nvim_list_bufs() )
do 117 - if vim.api.nvim_buf_is_loaded( bufnr )
and vim.api.nvim_buf_line_count( bufnr )
< MAX_INDEX_FILE_SIZE
then 118 - table.
insert( bufs, bufnr )
120 + formatting = formatting,
129 - formatting = formatting,
123 + completion = {
autocomplete =
false, },
125 + expand =
function ( args ) luasnip.lsp_expand( args.body )
end,
132 - completion = {
autocomplete =
false, },
134 - expand =
function ( args )
135 - luasnip.lsp_expand( args.body )
neovim/lua/bugabinga/terminal.lua
Modified23 23 command
= [[ <C-\><C-n> ]],
26 - map.terminal.normal {
27 - description =
'Close current terminal',
28 - category =
'terminal',
31 - command =
[[ <C-\><C-n><cmd>q<cr> ]],
34 26 vim.opt_local.spell
= false 36 27 vim.cmd.startinsert()