nvim: Update formatting

This commit is contained in:
Marty Oehme 2022-11-01 15:56:23 +01:00
parent ba5d5d2561
commit 7fbdbf0203
Signed by: Marty
GPG key ID: 73BA40D5AFAF49C9
6 changed files with 78 additions and 37 deletions

View file

@ -11,15 +11,18 @@ require('maps')
vim.api.nvim_create_autocmd({ "TextYankPost" }, { vim.api.nvim_create_autocmd({ "TextYankPost" }, {
command = 'silent! lua require"vim.highlight".on_yank{timeout=500}', command = 'silent! lua require"vim.highlight".on_yank{timeout=500}',
desc = "Highlight yanked text whenevery yanking something", desc = "Highlight yanked text whenevery yanking something",
group = vim.api.nvim_create_augroup('highlightyanks', { clear = true }), group = vim.api.nvim_create_augroup('highlightyanks', { clear = true })
}) })
-- Special setting for editing gopass files - make sure nothing leaks outside the directories it is supposed to -- Special setting for editing gopass files - make sure nothing leaks outside the directories it is supposed to
vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, { vim.api.nvim_create_autocmd({ "BufNewFile", "BufRead" }, {
pattern = { "/dev/shm/gopass.*", "/dev/shm/pass.?*/?*.txt", "$TMPDIR/pass.?*/?*.txt", "/tmp/pass.?*/?*.txt" }, pattern = {
"/dev/shm/gopass.*", "/dev/shm/pass.?*/?*.txt",
"$TMPDIR/pass.?*/?*.txt", "/tmp/pass.?*/?*.txt"
},
command = 'setlocal noswapfile nobackup noundofile nowritebackup viminfo=', command = 'setlocal noswapfile nobackup noundofile nowritebackup viminfo=',
desc = "Don't leak any information when editing potential password files", desc = "Don't leak any information when editing potential password files",
group = vim.api.nvim_create_augroup('passnoleak', { clear = true }), group = vim.api.nvim_create_augroup('passnoleak', { clear = true })
}) })
api.nvim_exec('runtime abbrev.vim', false) api.nvim_exec('runtime abbrev.vim', false)
@ -31,5 +34,5 @@ vim.api.nvim_create_autocmd({ "VimEnter" }, {
vim.defer_fn(function() vim.loop.kill(pid, WINCH) end, 20) vim.defer_fn(function() vim.loop.kill(pid, WINCH) end, 20)
end, end,
desc = "Fix neovim sizing issues if opening same time as alacritty", desc = "Fix neovim sizing issues if opening same time as alacritty",
group = vim.api.nvim_create_augroup('alacritty_fixsize', { clear = true }), group = vim.api.nvim_create_augroup('alacritty_fixsize', { clear = true })
}) })

View file

@ -14,5 +14,3 @@ local cmp_autopairs = require('nvim-autopairs.completion.cmp')
local cmp = require('cmp') local cmp = require('cmp')
cmp.event:on('confirm_done', cmp.event:on('confirm_done',
cmp_autopairs.on_confirm_done({ map_char = { tex = '' } })) cmp_autopairs.on_confirm_done({ map_char = { tex = '' } }))
-- add a lisp filetype (wrap my-function), FYI: Hardcoded = { "clojure", "clojurescript", "fennel", "janet" }
cmp_autopairs.lisp[#cmp_autopairs.lisp + 1] = "racket"

View file

@ -0,0 +1,40 @@
-- require('gitsigns').setup {
-- on_attach = function(bufnr)
-- local gs = package.loaded.gitsigns
--
-- local function map(mode, l, r, opts)
-- opts = opts or {}
-- opts.buffer = bufnr
-- vim.keymap.set(mode, l, r, opts)
-- end
--
-- -- Navigation
-- map('n', ']h', function()
-- if vim.wo.diff then return ']h' end
-- vim.schedule(function() gs.next_hunk() end)
-- return '<Ignore>'
-- end, {expr = true})
--
-- map('n', '[h', function()
-- if vim.wo.diff then return '[h' end
-- vim.schedule(function() gs.prev_hunk() end)
-- return '<Ignore>'
-- end, {expr = true})
--
-- -- Actions
-- map({'n', 'v'}, '<leader>hs', ':Gitsigns stage_hunk<CR>')
-- map('n', '<leader>hS', gs.stage_buffer)
-- map({'n', 'v'}, '<leader>hr', ':Gitsigns reset_hunk<CR>')
-- map('n', '<leader>hR', gs.reset_buffer)
-- map('n', '<leader>hu', gs.undo_stage_hunk)
-- map('n', '<leader>hp', gs.preview_hunk)
-- map('n', '<leader>hb', function() gs.blame_line {full = true} end)
-- map('n', '<leader>hB', gs.toggle_current_line_blame)
-- map('n', '<leader>hd', gs.diffthis)
-- map('n', '<leader>hD', function() gs.diffthis('~') end)
-- map('n', '<leader>hdd', gs.toggle_deleted)
--
-- -- Text object
-- map({'o', 'x'}, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
-- end
-- }

View file

@ -34,11 +34,7 @@ require("packer").startup(function()
'lewis6991/gitsigns.nvim', -- show vcs changes on left-hand gutter 'lewis6991/gitsigns.nvim', -- show vcs changes on left-hand gutter
requires = {'nvim-lua/plenary.nvim'}, requires = {'nvim-lua/plenary.nvim'},
tag = 'release', tag = 'release',
config = function() config = function() require('plug._gitsigns') end,
require('gitsigns').setup {
keymaps = {['n ]c'] = nil, ['n [c'] = nil}
}
end,
event = "BufRead" event = "BufRead"
} }
use { use {
@ -213,11 +209,15 @@ require("packer").startup(function()
-- lsp -- lsp
use 'neovim/nvim-lspconfig' -- some commong language server configurations use 'neovim/nvim-lspconfig' -- some commong language server configurations
use 'simrat39/symbols-outline.nvim' -- vista-like outline view for code use {
'simrat39/symbols-outline.nvim',
config = function() require('symbols-outline').setup() end
} -- vista-like outline view for code
use 'ray-x/lsp_signature.nvim' use 'ray-x/lsp_signature.nvim'
use { use {
'ray-x/navigator.lua', 'ray-x/navigator.lua',
requires = {'ray-x/guihua.lua', run = 'cd lua/fzy && make'} requires = {'ray-x/guihua.lua', run = 'cd lua/fzy && make'},
config = function() require('plug._lsp') end
} }
-- and completion -- and completion
use { use {

View file

@ -1,7 +1,7 @@
" PLUGIN: vim-pandoc " PLUGIN: vim-pandoc
" handle markdown files with pandoc (and pandoc syntax!) " handle markdown files with pandoc (and pandoc syntax!)
let g:pandoc#modules#disabled = [ "keyboard", "folding" ] let g:pandoc#modules#disabled = [ "keyboard", "folding" ]
let g:pandoc#filetypes#pandoc_markdown = 1 let g:pandoc#filetypes#pandoc_markdown = 0
let g:pandoc#filetypes#handled = [ "extra", "latex", "markdown", "pandoc", "rst", "textile"] let g:pandoc#filetypes#handled = [ "extra", "latex", "markdown", "pandoc", "rst", "textile"]
" disable all default keymaps " disable all default keymaps
let g:pandoc#keyboard#use_default_mappings=0 let g:pandoc#keyboard#use_default_mappings=0