repositories / dotfiles

dotfiles

bugabingas dorkfiles

owned by bugabinga

neovim: delete unused plugin neovim: modifies MiniPairs to only insert some pairs, when at the end of line

ea61ea0d1326a7a6875f4fbc5577945bbe0f1ef4

Oliver Jan Krylow <oliver@bugabinga.net> ·

unsigned

Browse filesCompare with HEAD

Changed files (6)

neovim/init.lua

Modified
45 45 require 'bugabinga.save_actions'
46 46 require 'bugabinga.lsp'
47 47 require 'bugabinga.java'
48 -require 'bugabinga.in_and_out'
49 48 require 'bugabinga.mkdir'
50 49 require 'bugabinga.diagnostic'

neovim/lua/bugabinga/in_and_out.lua

Deleted
deleted file mode 100644
1 --- Stolen from https://github.com/ysmb-wtsg/in-and-out.nvim
2 -local map = require 'std.map'
4 -local function escape_lua_pattern( s )
5 - local matches = {
6 - ['^'] = '%^',
7 - ['$'] = '%$',
8 - ['('] = '%(',
9 - [')'] = '%)',
10 - ['%'] = '%%',
11 - ['.'] = '%.',
12 - ['['] = '%[',
13 - [']'] = '%]',
14 - ['*'] = '%*',
15 - ['+'] = '%+',
16 - ['-'] = '%-',
17 - ['?'] = '%?',
18 - }
19 - return s:gsub( '.', matches )
20 -end
22 -local targets = { '"', "'", '(', ')', '{', '}', '[', ']', '`' }
24 -local in_and_out = function ()
25 - local current_row, current_col = unpack( vim.api.nvim_win_get_cursor( 0 ) )
26 - local lines_in_buf = vim.api.nvim_buf_get_lines( 0, current_row - 1, -1, false )
28 - local target_row = 0
29 - local target_col = nil
30 - for i, line in ipairs( lines_in_buf ) do
31 - for _, char in ipairs( targets ) do
32 - local found_col = string.find( line, escape_lua_pattern( char ), current_col + 1 )
33 - if found_col and (not target_col or found_col < target_col) then
34 - -- If char is a multibyte character, we need to take into account the extra bytes.
35 - target_col = found_col + vim.fn.strlen( char ) - 1
36 - end
37 - end
38 - if target_col then
39 - target_row = current_row + i - 1
40 - break
41 - end
42 - current_col = 0
43 - end
44 - if target_col then
45 - vim.api.nvim_win_set_cursor( 0, { target_row, target_col } )
46 - end
47 -end
49 -map.insert {
50 - description = 'Moves in or out of balanced tokens',
51 - category = 'editing',
52 - keys = '<C-CR>',
53 - command = in_and_out,
54 -}

neovim/lua/bugabinga/lsp.lua

Modified
107 107 local lspconfig = puk 'lspconfig'
108 -for server, config in pairs(language_servers) do
108 +for server, config in pairs( language_servers ) do
109 109 local capabilities = vim.lsp.protocol.make_client_capabilities()
110 110 capabilities.textDocument.semanticTokens.multilineTokenSupport = true
111 111 config.capabilities = capabilites
113 113 -- TODO Re-implement local settings overrides
114 114 -- local settings_override = local_settings(server) or {}
115 115 -- config.settings = table.extend('force', settings, settings_override)
116 - lspconfig[server].setup(config)
116 + lspconfig[server].setup( config )
119 -local lsp_attach = function(args)
119 +local lsp_attach = function ( args )
120 120 local bufnr = args.buf
121 121 local client_id = args.data.client_id
122 - local client = vim.lsp.get_client_by_id(client_id)
122 + local client = vim.lsp.get_client_by_id( client_id )
123 123 if not client then return end
125 - vim.lsp.completion.enable(true, client_id, bufnr)
125 + vim.lsp.completion.enable( true, client_id, bufnr )
127 127 -- the following are already set by default
128 128 -- but I will remap them anyways for consistency
198 198 description = 'type hierarchy (subtypes)',
199 199 category = 'lsp',
200 200 keys = 'grh',
201 - command = function() vim.lsp.buf.typehierarchy 'subtypes' end,
201 + command = function () vim.lsp.buf.typehierarchy 'subtypes' end,
203 203 map.normal {
204 204 description = 'type hierarchy (supertypes)',
205 205 category = 'lsp',
206 206 keys = 'grH',
207 - command = function() vim.lsp.buf.typehierarchy 'supertypes' end,
207 + command = function () vim.lsp.buf.typehierarchy 'supertypes' end,
210 210 map.insert {
220 220 category = 'lsp',
221 221 buffer = bufnr,
222 222 keys = '<leader>ti',
223 - command = function()
224 - vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
223 + command = function ()
224 + vim.lsp.inlay_hint.enable( not vim.lsp.inlay_hint.is_enabled() )
260 260 local completion_kinds = vim.lsp.protocol.CompletionItemKind
261 -for i, kind in ipairs(completion_kinds) do
261 +for i, kind in ipairs( completion_kinds ) do
262 262 completion_kinds[i] = completion_icons[kind] or kind

neovim/lua/bugabinga/pairs.lua

Modified
1 1 local puk = require 'std.puk'
3 -puk.defer 'mini.pairs' (function(pairs)
4 - pairs.setup {}
5 -end)
3 +puk.defer 'mini.pairs' ( function ( pairs )
4 + pairs.setup {
5 + mappings = {
6 + ['('] = { action = 'open', pair = '()', neigh_pattern = '.\n' },
7 + ['['] = { action = 'open', pair = '[]', neigh_pattern = '.\n' },
8 + ['{'] = { action = 'open', pair = '{}', neigh_pattern = '.\n' },
9 + ['<'] = { action = 'open', pair = '<>', neigh_pattern = '.\n' },
11 + [')'] = { action = 'close', pair = '()', neigh_pattern = '[^\\].' },
12 + [']'] = { action = 'close', pair = '[]', neigh_pattern = '[^\\].' },
13 + ['}'] = { action = 'close', pair = '{}', neigh_pattern = '[^\\].' },
14 + ['>'] = { action = 'close', pair = '<>', neigh_pattern = '[^\\].' },
16 + ['"'] = false,
17 + ["'"] = false,
18 + ['`'] = false,
19 + },
20 + }
21 +end )

neovim/lua/bugabinga/surround.lua

Modified
11 11 normal = 'sa',
12 12 normal_line = 'sA',
13 14 normal_cur = 'sc',
14 15 normal_cur_line = 'sC',

neovim/lua/std/ignored.lua

Modified
17 17 'notify',
18 18 'nvim-docs-view',
19 19 'oil',
20 + 'oil_progress',
20 21 'qf',
21 22 'netrw',
22 23 'svn',