mirror of
https://github.com/ksyasuda/rice.git
synced 2025-12-07 02:53:38 -08:00
updates
This commit is contained in:
2
nvim/plugin-confs/git-blame.lua
Normal file
2
nvim/plugin-confs/git-blame.lua
Normal file
@@ -0,0 +1,2 @@
|
||||
vim.g.gitblame_highlight_group = "Question"
|
||||
vim.g.gitblame_enabled = 0
|
||||
43
nvim/plugin-confs/gitsigns.lua
Normal file
43
nvim/plugin-confs/gitsigns.lua
Normal file
@@ -0,0 +1,43 @@
|
||||
require('gitsigns').setup {
|
||||
signs = {
|
||||
add = {hl = 'GitSignsAdd' , text = '│', numhl='GitSignsAddNr' , linehl='GitSignsAddLn'},
|
||||
change = {hl = 'GitSignsChange', text = '│', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
||||
delete = {hl = 'GitSignsDelete', text = '_', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
||||
topdelete = {hl = 'GitSignsDelete', text = '‾', numhl='GitSignsDeleteNr', linehl='GitSignsDeleteLn'},
|
||||
changedelete = {hl = 'GitSignsChange', text = '~', numhl='GitSignsChangeNr', linehl='GitSignsChangeLn'},
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
interval = 1000,
|
||||
follow_files = true
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter_opts = {
|
||||
relative_time = false
|
||||
},
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000,
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = 'single',
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
yadm = {
|
||||
enable = false
|
||||
},
|
||||
}
|
||||
@@ -1,10 +1,10 @@
|
||||
require('goto-preview').setup {
|
||||
width = 120; -- Width of the floating window
|
||||
height = 15; -- Height of the floating window
|
||||
height = 20; -- Height of the floating window
|
||||
border = {"↖", "─" ,"┐", "│", "┘", "─", "└", "│"}; -- Border characters of the floating window
|
||||
default_mappings = false; -- Bind default mappings
|
||||
debug = false; -- Print debug information
|
||||
opacity = nil; -- 0-100 opacity level of the floating window where 100 is fully transparent.
|
||||
opacity = 25; -- 0-100 opacity level of the floating window where 100 is fully transparent.
|
||||
resizing_mappings = false; -- Binds arrow keys to resizing the floating window.
|
||||
post_open_hook = nil; -- A function taking two arguments, a buffer and a window to be ran as a hook.
|
||||
references = { -- Configure the telescope UI for slowing the references cycling window.
|
||||
@@ -13,6 +13,6 @@ require('goto-preview').setup {
|
||||
-- These two configs can also be passed down to the goto-preview definition and implementation calls for one off "peak" functionality.
|
||||
focus_on_open = true; -- Focus the floating window when opening it.
|
||||
dismiss_on_move = false; -- Dismiss the floating window when moving the cursor.
|
||||
force_close = true, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close
|
||||
force_close = false, -- passed into vim.api.nvim_win_close's second argument. See :h nvim_win_close
|
||||
bufhidden = "wipe", -- the bufhidden option to set on the floating window. See :h bufhidden
|
||||
}
|
||||
|
||||
@@ -12,31 +12,33 @@ local on_attach = function(client, bufnr)
|
||||
|
||||
-- Mappings.
|
||||
-- See `:help vim.lsp.*` for documentation on any of the below functions
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-k>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
if client.resolved_capabilities.document_highlight then
|
||||
vim.cmd [[
|
||||
hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
|
||||
hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
|
||||
hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
|
||||
augroup lsp_document_highlight
|
||||
autocmd! * <buffer>
|
||||
autocmd! CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
||||
autocmd! CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
||||
augroup END
|
||||
]]
|
||||
end
|
||||
-- set in ~/.config/nvim/keybindings.vim
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gD', '<cmd>lua vim.lsp.buf.declaration()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gd', '<cmd>lua vim.lsp.buf.definition()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'K', '<cmd>lua vim.lsp.buf.hover()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gi', '<cmd>lua vim.lsp.buf.implementation()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<C-s>', '<cmd>lua vim.lsp.buf.signature_help()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wa', '<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wr', '<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>wl', '<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>D', '<cmd>lua vim.lsp.buf.type_definition()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>rn', '<cmd>lua vim.lsp.buf.rename()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>ca', '<cmd>lua vim.lsp.buf.code_action()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', 'gr', '<cmd>lua vim.lsp.buf.references()<CR>', opts)
|
||||
-- vim.api.nvim_buf_set_keymap(bufnr, 'n', '<space>f', '<cmd>lua vim.lsp.buf.formatting()<CR>', opts)
|
||||
-- highlighting things under cursor
|
||||
-- if client.resolved_capabilities.document_highlight then
|
||||
-- vim.cmd [[
|
||||
-- hi! LspReferenceRead cterm=bold ctermbg=red guibg=LightYellow
|
||||
-- hi! LspReferenceText cterm=bold ctermbg=red guibg=LightYellow
|
||||
-- hi! LspReferenceWrite cterm=bold ctermbg=red guibg=LightYellow
|
||||
-- augroup lsp_document_highlight
|
||||
-- autocmd! * <buffer>
|
||||
-- autocmd! CursorHold <buffer> lua vim.lsp.buf.document_highlight()
|
||||
-- autocmd! CursorMoved <buffer> lua vim.lsp.buf.clear_references()
|
||||
-- augroup END
|
||||
-- ]]
|
||||
-- end
|
||||
end
|
||||
|
||||
vim.cmd [[autocmd! ColorScheme * highlight NormalFloat guibg=#1f2335]]
|
||||
@@ -109,7 +111,7 @@ vim.diagnostic.config({
|
||||
signs = true,
|
||||
underline = true,
|
||||
update_in_insert = false,
|
||||
severity_sort = false,
|
||||
severity_sort = true,
|
||||
})
|
||||
|
||||
local signs = { Error = " ", Warn = " ", Hint = " ", Info = " " }
|
||||
|
||||
@@ -14,6 +14,7 @@ require("null-ls").setup({
|
||||
end,
|
||||
sources = {
|
||||
require("null-ls").builtins.completion.spell,
|
||||
require("null-ls").builtins.code_actions.gitsigns,
|
||||
require("null-ls").builtins.formatting.shfmt.with({
|
||||
filetypes = {"sh", "bash"},
|
||||
extra_args = { "-i", "4", "-ci", "-sr" }
|
||||
|
||||
Reference in New Issue
Block a user