Skip to content

Commit

Permalink
fix: syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
rafi committed Sep 30, 2024
1 parent 5a02aed commit 814f312
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 23 deletions.
3 changes: 1 addition & 2 deletions after/ftplugin/gitrebase.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
--

local function setup_undo()
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
.. (vim.b.undo_ftplugin ~= nil and ' | ' or '')
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n '
.. 'sil! nunmap <buffer> <Tab>'
.. ' | sil! nunmap <buffer> <S-Tab>'
end
Expand Down
3 changes: 1 addition & 2 deletions after/ftplugin/help.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ vim.keymap.set('n', 'O', 'h?|\\S\\+|<CR>:nohlsearch<CR>', opts)
vim.keymap.set('n', 'p', '/\\*\\S\\+\\*<CR>:nohlsearch<CR>', opts)
vim.keymap.set('n', 'P', 'h?\\*\\S\\+\\*<CR>:nohlsearch<CR>', opts)

vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
.. (vim.b.undo_ftplugin ~= nil and ' | ' or '')
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n '
.. 'setlocal spell< list<'
.. ' | sil! nunmap <buffer> <CR>'
.. ' | sil! nunmap <buffer> <BS>'
Expand Down
3 changes: 1 addition & 2 deletions after/ftplugin/man.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ vim.keymap.set('n', '<Leader>o', function()
require('man').show_toc()
end, opts)

vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
.. (vim.b.undo_ftplugin ~= nil and ' | ' or '')
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n '
.. 'sil! nunmap <buffer> <Leader>o'
.. ' | sil! nunmap <buffer> q'
3 changes: 1 addition & 2 deletions after/ftplugin/markdown.lua
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ local opts = { noremap = true, buffer = 0 }
vim.keymap.set('n', '<C-Return>', link_surround, opts)
vim.keymap.set('x', '<C-Return>', link_surround, opts)

vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '')
.. (vim.b.undo_ftplugin ~= nil and ' | ' or '')
vim.b.undo_ftplugin = (vim.b.undo_ftplugin or '') .. '\n '
.. 'sil! nunmap <buffer> <C-Return>'
.. ' | sil! xunmap <buffer> <C-Return>'
2 changes: 1 addition & 1 deletion init.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
-- Rafael Bodill's Neovim entry-point
-- https://github.com/rafi/vim-config

local stdconfig = vim.fn.stdpath('config')
local stdconfig = vim.fn.stdpath('config') --[[@as string]]
local lazy_override = stdconfig .. '/lua/config/lazy.lua'

vim.uv = vim.uv or vim.loop
Expand Down
2 changes: 1 addition & 1 deletion lua/rafi/config/keymaps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ map('n', '#', 'g#')
map('n', 'g#', '#')

-- Clear search with <Esc>
map('n', '<Esc>', '<cmd>noh<CR>', { desc = 'Escape and Clear hlsearch' })
map('n', '<Esc>', '<cmd>noh<CR>', { desc = 'Clear hlsearch' })

-- Use backspace key for matching pairs
map({ 'n', 'x' }, '<BS>', '%', { remap = true, desc = 'Jump to Paren' })
Expand Down
5 changes: 4 additions & 1 deletion lua/rafi/config/options.lua
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ vim.g.root_spec = { 'lsp', { '.git', 'lua' }, 'cwd' }

-- LazyVim automatically configures lazygit:
-- * theme, based on the active colorscheme.
-- * editorPreset to nvim-remote
-- * editPreset to nvim-remote
-- * enables nerd font icons
-- Set to false to disable.
-- Set the options you want to override in `~/.config/lazygit/custom.yml`
-- WARN: on Windows you might want to set `editPreset: "nvim"` due to
-- this issue https://github.com/jesseduffield/lazygit/issues/3467
vim.g.lazygit_config = true

-- Options for the LazyVim statuscolumn
Expand Down
2 changes: 1 addition & 1 deletion lua/rafi/plugins/editor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ return {
function()
local grug = require('grug-far')
local ext = vim.bo.buftype == '' and vim.fn.expand('%:e')
grug.grug_far({
grug.open({
transient = true,
prefills = {
filesFilter = ext and ext ~= '' and '*.' .. ext or nil,
Expand Down
21 changes: 10 additions & 11 deletions lua/rafi/util/contextmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -42,38 +42,37 @@ M.show = function()
if cword == '' then
-- Cursor is on blank character.
vim.cmd([[
nmenu PopUp.Select\ All ggVG
nmenu PopUp.-1- <Nop>
nmenu PopUp.Select\ All ggVG
nnoremenu PopUp.-1- <Nop>
]])
else
-- Add LSP methods, only if one of the servers support it.
if supports_method('textDocument/declaration', clients) then
vim.cmd('nmenu PopUp.Declaration <cmd>lua vim.lsp.buf.declaration()<CR>')
end
if supports_method('textDocument/definition', clients) then
vim.cmd('nmenu PopUp.&Definition <cmd>lua vim.lsp.buf.definition()<CR>')
vim.cmd(
'nnoremenu PopUp.Go\\ to\\ &definition <cmd>lua vim.lsp.buf.definition()<CR>'
)
end

if supports_method('textDocument/references', clients) then
vim.cmd(
'nmenu PopUp.&References… <cmd>lua vim.lsp.buf.references()<CR>'
'nnoremenu PopUp.Go\\ to\\ &references… <cmd>lua vim.lsp.buf.references()<CR>'
)
end
if supports_method('textDocument/implementation', clients) then
vim.cmd(
'nmenu PopUp.Implementation <cmd>lua vim.lsp.buf.implementation()<CR>'
'nnoremenu PopUp.Implementation <cmd>lua vim.lsp.buf.implementation()<CR>'
)
end

if #clients > 0 then
vim.cmd([[
nmenu PopUp.-1- <Nop>
nmenu PopUp.Find\ symbol… <cmd>lua vim.schedule(function() require'telescope.builtin'.lsp_workspace_symbols({default_text = vim.fn.expand('<cword>')}) end)<CR>
nnoremenu PopUp.-1- <Nop>
nmenu PopUp.Find\ symbol… <cmd>lua require'telescope.builtin'.lsp_workspace_symbols({default_text = vim.fn.expand('<cword>')})<CR>
]])
end

vim.cmd([[
nmenu PopUp.Grep… <cmd>lua vim.schedule(function() require'telescope.builtin'.live_grep({default_text = vim.fn.expand('<cword>')}) end)<CR>
nmenu PopUp.Grep… <cmd>lua require'telescope.builtin'.live_grep({default_text = vim.fn.expand('<cword>')})<CR>
nmenu PopUp.-2- <Nop>
]])
end
Expand Down

0 comments on commit 814f312

Please sign in to comment.