add color names, highlighing on hover, and keybindings
This commit is contained in:
parent
9579c18f98
commit
d0ea29e2b5
@ -36,7 +36,7 @@ nnoremap gA :lua vim.lsp.buf.code_actions()<CR>
|
|||||||
nnoremap gd :Telescope lsp_definitions<CR>
|
nnoremap gd :Telescope lsp_definitions<CR>
|
||||||
nnoremap gDc :Telescope lsp_implementations<CR>
|
nnoremap gDc :Telescope lsp_implementations<CR>
|
||||||
nnoremap gDf :Telescope lsp_definitions<CR>
|
nnoremap gDf :Telescope lsp_definitions<CR>
|
||||||
nnoremap gF :edit <cfile><cr>
|
nnoremap gF :edit <cfile><CR>
|
||||||
nnoremap gT :Telescope lsp_type_definitions<CR>
|
nnoremap gT :Telescope lsp_type_definitions<CR>
|
||||||
nnoremap gb :Gitsigns blame_line<CR>
|
nnoremap gb :Gitsigns blame_line<CR>
|
||||||
nnoremap gi :Telescope lsp_implementations<CR>
|
nnoremap gi :Telescope lsp_implementations<CR>
|
||||||
@ -105,17 +105,18 @@ nnoremap <leader>ek :e ~/.config/nvim/keybindings.vim<CR>
|
|||||||
nnoremap <leader>ep :e ~/.config/nvim/lua/plugins.lua<CR>
|
nnoremap <leader>ep :e ~/.config/nvim/lua/plugins.lua<CR>
|
||||||
nnoremap <leader>es :e ~/.config/nvim/lua/settings.lua<CR>
|
nnoremap <leader>es :e ~/.config/nvim/lua/settings.lua<CR>
|
||||||
|
|
||||||
nnoremap <leader>fb :Telescope file_browser<cr>
|
nnoremap <leader>fb :Telescope file_browser<CR>
|
||||||
nnoremap <leader>ff :Telescope find_files<cr>
|
nnoremap <leader>fc :Telescope color_names theme=dropdown layout_config={width=0.45,height=25,prompt_position="bottom"} layout_strategy=vertical<CR>
|
||||||
nnoremap <leader>fg :Telescope live_grep<cr>
|
nnoremap <leader>ff :Telescope find_files<CR>
|
||||||
nnoremap <leader>fr :Telescope oldfiles<cr>
|
nnoremap <leader>fg :Telescope glyph theme=dropdown layout_config={width=0.45,height=35,prompt_position="bottom"} layout_strategy=vertical<CR>
|
||||||
|
nnoremap <leader>fr :Telescope oldfiles<CR>
|
||||||
|
|
||||||
nnoremap <leader>gb :Gitsigns blame_line<CR>
|
nnoremap <leader>gb :Gitsigns blame_line<CR>
|
||||||
nnoremap <leader>gc :Telescope git_commits<CR>
|
nnoremap <leader>gc :Telescope git_commits<CR>
|
||||||
nnoremap <leader>gf :Telescope git_files<CR>
|
nnoremap <leader>gf :Telescope git_files<CR>
|
||||||
nnoremap <leader>gg :FloatermNew --title=lazygit --width=1.0 --height=1.0 --opener=vsplit lazygit<CR>
|
nnoremap <leader>gg :FloatermNew --title=lazygit --width=1.0 --height=1.0 --opener=vsplit lazygit<CR>
|
||||||
nnoremap gP <cmd>lua require('goto-preview').close_all_win()<CR>
|
nnoremap gP <cmd>lua require('goto-preview').close_all_win()<CR>
|
||||||
nnoremap gR <cmd>Telescope lsp_references<cr>
|
nnoremap gR <cmd>Telescope lsp_references<CR>
|
||||||
nnoremap gpc <cmd>lua require('goto-preview').close_all_win()<CR>
|
nnoremap gpc <cmd>lua require('goto-preview').close_all_win()<CR>
|
||||||
nnoremap gpd <cmd>lua require('goto-preview').goto_preview_definition()<CR>
|
nnoremap gpd <cmd>lua require('goto-preview').goto_preview_definition()<CR>
|
||||||
nnoremap gpi <cmd>lua require('goto-preview').goto_preview_implementation()<CR>
|
nnoremap gpi <cmd>lua require('goto-preview').goto_preview_implementation()<CR>
|
||||||
@ -126,7 +127,7 @@ nnoremap <leader>hdC :Telescope dap configurations<CR>
|
|||||||
nnoremap <leader>hdb :Telescope dap list_breakpoints<CR>
|
nnoremap <leader>hdb :Telescope dap list_breakpoints<CR>
|
||||||
nnoremap <leader>hdv :Telescope dap variables<CR>
|
nnoremap <leader>hdv :Telescope dap variables<CR>
|
||||||
nnoremap <leader>hdf :Telescope dap frames<CR>
|
nnoremap <leader>hdf :Telescope dap frames<CR>
|
||||||
nnoremap <leader>hv :Telescope vim_options<cr>
|
nnoremap <leader>hv :Telescope vim_options<CR>
|
||||||
nnoremap <leader>hk :Telescope keymaps<CR>
|
nnoremap <leader>hk :Telescope keymaps<CR>
|
||||||
nnoremap <leader>hs :Telescope spell_suggest<CR>
|
nnoremap <leader>hs :Telescope spell_suggest<CR>
|
||||||
|
|
||||||
@ -166,10 +167,10 @@ nnoremap <leader>oP :FloatermNew --title=ipython-full --name=ipython-full --open
|
|||||||
nnoremap <leader>or :FloatermNew --title=ranger --opener=vsplit ranger --cmd="cd $PWD"<CR>
|
nnoremap <leader>or :FloatermNew --title=ranger --opener=vsplit ranger --cmd="cd $PWD"<CR>
|
||||||
nnoremap <leader>ot :FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=vsplit --position=botright --width=0.5<CR>
|
nnoremap <leader>ot :FloatermNew --title=floaterm --name=split-term --opener=edit --wintype=vsplit --position=botright --width=0.5<CR>
|
||||||
|
|
||||||
nnoremap <leader>sc :nohls<Cr>
|
nnoremap <leader>sc :nohls<CR>
|
||||||
nnoremap <leader>sC :Telescope commands<Cr>
|
nnoremap <leader>sC :Telescope commands<CR>
|
||||||
nnoremap <leader>sf :Telescope find_files<Cr>
|
nnoremap <leader>sf :Telescope find_files<CR>
|
||||||
nnoremap <leader>sg :Telescope glyph<Cr>
|
nnoremap <leader>sg :Telescope live_grep<CR>
|
||||||
nnoremap <leader>sh :Telescope command_history<CR>
|
nnoremap <leader>sh :Telescope command_history<CR>
|
||||||
nnoremap <leader>sm :Telescope man_pages<CR>
|
nnoremap <leader>sm :Telescope man_pages<CR>
|
||||||
nnoremap <leader>s/ :Telescope search_history<CR>
|
nnoremap <leader>s/ :Telescope search_history<CR>
|
||||||
@ -180,6 +181,10 @@ nnoremap <silent> <leader>tp :FloatermToggle ipython<CR>
|
|||||||
nnoremap <silent> <leader>tP :FloatermToggle ipython-full<CR>
|
nnoremap <silent> <leader>tP :FloatermToggle ipython-full<CR>
|
||||||
nnoremap <silent> <leader>tt :FloatermToggle split-term<CR>
|
nnoremap <silent> <leader>tt :FloatermToggle split-term<CR>
|
||||||
nnoremap <silent> <leader>td :DBUIToggle<CR>
|
nnoremap <silent> <leader>td :DBUIToggle<CR>
|
||||||
|
nnoremap <silent> <leader>Tc :Telescope color_names theme=dropdown layout_config={width=0.45,height=25,prompt_position="bottom"} layout_strategy=vertical<CR>
|
||||||
|
nnoremap <silent> <leader>Tg :Telescope glyph theme=dropdown layout_config={width=0.45,height=35,prompt_position="bottom"} layout_strategy=vertical<CR>
|
||||||
|
nnoremap <silent> <leader>Tn :Telescope notify<CR>
|
||||||
|
nnoremap <silent> <leader>Tt :Telescope<CR>
|
||||||
|
|
||||||
nnoremap <leader>wa :lua vim.lsp.buf.add_workspace_folder()<CR>
|
nnoremap <leader>wa :lua vim.lsp.buf.add_workspace_folder()<CR>
|
||||||
nnoremap <leader>wl :lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>
|
nnoremap <leader>wl :lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>
|
||||||
|
@ -17,6 +17,7 @@ require('packer').startup(function(use)
|
|||||||
use { 'nvim-telescope/telescope-file-browser.nvim' }
|
use { 'nvim-telescope/telescope-file-browser.nvim' }
|
||||||
use 'nvim-telescope/telescope-dap.nvim'
|
use 'nvim-telescope/telescope-dap.nvim'
|
||||||
use { 'ghassan0/telescope-glyph.nvim' }
|
use { 'ghassan0/telescope-glyph.nvim' }
|
||||||
|
use { 'nat-418/telescope-color-names.nvim' }
|
||||||
use {
|
use {
|
||||||
'nvim-telescope/telescope-fzf-native.nvim',
|
'nvim-telescope/telescope-fzf-native.nvim',
|
||||||
run =
|
run =
|
||||||
@ -268,48 +269,6 @@ require('packer').startup(function(use)
|
|||||||
use {
|
use {
|
||||||
'glepnir/dashboard-nvim',
|
'glepnir/dashboard-nvim',
|
||||||
-- event = 'VimEnter',
|
-- event = 'VimEnter',
|
||||||
config = function()
|
|
||||||
require('dashboard').setup {
|
|
||||||
theme = 'doom', -- theme is doom and hyper default is hyper
|
|
||||||
disable_move = false, -- default is false disable move keymap for hyper
|
|
||||||
shortcut_type = 'number', -- shorcut type 'letter' or 'number'
|
|
||||||
change_to_vcs_root = false, -- default is false,for open file in hyper mru. it will change to the root of vcs
|
|
||||||
config = {
|
|
||||||
header = { "NVIM DASHBOARD" }, -- your header
|
|
||||||
center = {
|
|
||||||
{
|
|
||||||
icon = ' ',
|
|
||||||
icon_hl = 'Title',
|
|
||||||
desc = 'Find File ',
|
|
||||||
desc_hl = 'String',
|
|
||||||
key = 'b',
|
|
||||||
keymap = 'SPC f f',
|
|
||||||
key_hl = 'Number',
|
|
||||||
action = 'lua print(2)'
|
|
||||||
}
|
|
||||||
-- {
|
|
||||||
-- icon = ' ',
|
|
||||||
-- desc = 'Find Dotfiles',
|
|
||||||
-- key = 'f',
|
|
||||||
-- keymap = 'SPC f d',
|
|
||||||
-- action = 'lua print(3)'
|
|
||||||
-- }
|
|
||||||
},
|
|
||||||
footer = {} -- your footer
|
|
||||||
},
|
|
||||||
hide = {
|
|
||||||
statusline = true, -- hide statusline default is true
|
|
||||||
tabline = true, -- hide the tabline
|
|
||||||
winbar = true -- hide winbar
|
|
||||||
}
|
|
||||||
-- preview = {
|
|
||||||
-- command = "bat", -- preview command
|
|
||||||
-- file_path -- preview file path
|
|
||||||
-- file_height -- preview file height
|
|
||||||
-- file_width -- preview file width
|
|
||||||
-- },
|
|
||||||
}
|
|
||||||
end,
|
|
||||||
requires = { 'nvim-tree/nvim-web-devicons' }
|
requires = { 'nvim-tree/nvim-web-devicons' }
|
||||||
}
|
}
|
||||||
use {
|
use {
|
||||||
|
@ -9,28 +9,85 @@ local db = require('dashboard')
|
|||||||
-- db.preview_file_width = 70
|
-- db.preview_file_width = 70
|
||||||
vim.cmd('source $HOME/.config/nvim/static/nvim-dashboard.vim')
|
vim.cmd('source $HOME/.config/nvim/static/nvim-dashboard.vim')
|
||||||
db.custom_center = {
|
db.custom_center = {
|
||||||
{icon = ' ',
|
{
|
||||||
desc = 'Recently latest session ',
|
icon = ' ',
|
||||||
shortcut = 'SPC s l',
|
desc = 'Recently latest session ',
|
||||||
action ='SessionLoad'},
|
shortcut = 'SPC s l',
|
||||||
{icon = ' ',
|
action = 'SessionLoad'
|
||||||
desc = 'Recently opened files ',
|
}, {
|
||||||
action = 'Telescope oldfiles',
|
icon = ' ',
|
||||||
shortcut = 'SPC f h'},
|
desc = 'Recently opened files ',
|
||||||
{icon = ' ',
|
action = 'Telescope oldfiles',
|
||||||
desc = 'Find File ',
|
shortcut = 'SPC f h'
|
||||||
action = 'Telescope find_files find_command=rg,--hidden,--files',
|
}, {
|
||||||
shortcut = 'SPC f f'},
|
desc = 'Find File ',
|
||||||
{icon = ' ',
|
icon = ' ',
|
||||||
desc ='File Browser ',
|
action = 'Telescope find_files find_command=rg,--hidden,--files',
|
||||||
action = 'Telescope file_browser',
|
shortcut = 'SPC f f'
|
||||||
shortcut = 'SPC f b'},
|
}, {
|
||||||
{icon = ' ',
|
icon = ' ',
|
||||||
desc = 'Find word ',
|
desc = 'File Browser ',
|
||||||
action = 'Telescope live_grep',
|
action = 'Telescope file_browser',
|
||||||
shortcut = 'SPC f w'},
|
shortcut = 'SPC f b'
|
||||||
{icon = ' ',
|
}, {
|
||||||
desc = 'Open Personal dotfiles ',
|
icon = ' ',
|
||||||
action = ':e ~/.config/nvim/init.vim',
|
desc = 'Find word ',
|
||||||
shortcut = 'SPC f d'},
|
action = 'Telescope live_grep',
|
||||||
|
shortcut = 'SPC f w'
|
||||||
|
}, {
|
||||||
|
icon = ' ',
|
||||||
|
desc = 'Open Personal dotfiles ',
|
||||||
|
action = ':e ~/.config/nvim/init.vim',
|
||||||
|
shortcut = 'SPC f d'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
require('dashboard').setup {
|
||||||
|
theme = 'doom', -- theme is doom and hyper default is hyper
|
||||||
|
disable_move = false, -- default is false disable move keymap for hyper
|
||||||
|
shortcut_type = 'number', -- shorcut type 'letter' or 'number'
|
||||||
|
change_to_vcs_root = false, -- default is false,for open file in hyper mru. it will change to the root of vcs
|
||||||
|
config = {
|
||||||
|
header = { "NVIM DASHBOARD" }, -- your header
|
||||||
|
center = {
|
||||||
|
{
|
||||||
|
icon = ' ',
|
||||||
|
icon_hl = 'Title',
|
||||||
|
desc = 'Open Recent',
|
||||||
|
desc_hl = 'String',
|
||||||
|
key = '1',
|
||||||
|
keymap = 'SPC f r',
|
||||||
|
key_hl = 'Number',
|
||||||
|
action = 'lua print(1)'
|
||||||
|
}, {
|
||||||
|
icon = ' ',
|
||||||
|
icon_hl = 'Title',
|
||||||
|
desc = 'Find File',
|
||||||
|
desc_hl = 'String',
|
||||||
|
key = '2',
|
||||||
|
key_hl = 'Number',
|
||||||
|
keymap = 'SPC f f',
|
||||||
|
action = 'lua print(2)'
|
||||||
|
}
|
||||||
|
|
||||||
|
-- {
|
||||||
|
-- icon = ' ',
|
||||||
|
-- desc = 'Find Dotfiles',
|
||||||
|
-- key = 'f',
|
||||||
|
-- keymap = 'SPC f d',
|
||||||
|
-- action = 'lua print(3)'
|
||||||
|
-- }
|
||||||
|
},
|
||||||
|
footer = {} -- your footer
|
||||||
|
},
|
||||||
|
hide = {
|
||||||
|
statusline = true, -- hide statusline default is true
|
||||||
|
tabline = true, -- hide the tabline
|
||||||
|
winbar = true -- hide winbar
|
||||||
|
}
|
||||||
|
-- preview = {
|
||||||
|
-- command = "bat", -- preview command
|
||||||
|
-- file_path -- preview file path
|
||||||
|
-- file_height -- preview file height
|
||||||
|
-- file_width -- preview file width
|
||||||
|
-- },
|
||||||
}
|
}
|
||||||
|
@ -6,6 +6,29 @@ local lspconfig = require('lspconfig')
|
|||||||
local luasnip = require 'luasnip'
|
local luasnip = require 'luasnip'
|
||||||
local highlight = require('cmp.utils.highlight')
|
local highlight = require('cmp.utils.highlight')
|
||||||
|
|
||||||
|
local highlight_symbol_under_cursor = function()
|
||||||
|
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
|
||||||
|
]]
|
||||||
|
vim.api.nvim_create_augroup('lsp_document_highlight', { clear = false })
|
||||||
|
vim.api.nvim_clear_autocmds({
|
||||||
|
buffer = bufnr,
|
||||||
|
group = 'lsp_document_highlight'
|
||||||
|
})
|
||||||
|
vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
||||||
|
group = 'lsp_document_highlight',
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = vim.lsp.buf.document_highlight
|
||||||
|
})
|
||||||
|
vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
||||||
|
group = 'lsp_document_highlight',
|
||||||
|
buffer = bufnr,
|
||||||
|
callback = vim.lsp.buf.clear_references
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
local has_words_before = function()
|
local has_words_before = function()
|
||||||
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
if vim.api.nvim_buf_get_option(0, "buftype") == "prompt" then
|
||||||
return false
|
return false
|
||||||
@ -221,12 +244,13 @@ for _, lsp in ipairs(servers) do
|
|||||||
if lsp == 'lua_ls' then
|
if lsp == 'lua_ls' then
|
||||||
lspconfig[lsp].setup {
|
lspconfig[lsp].setup {
|
||||||
-- on_attach = my_custom_on_attach,
|
-- on_attach = my_custom_on_attach,
|
||||||
|
on_attach = highlight_symbol_under_cursor(),
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
callSnippet = "Replace"
|
callSnippet = "Replace"
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
lspconfig[lsp].setup {
|
lspconfig[lsp].setup {
|
||||||
-- on_attach = my_custom_on_attach,
|
on_attach = highlight_symbol_under_cursor(),
|
||||||
capabilities = capabilities
|
capabilities = capabilities
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
@ -63,3 +63,5 @@ ts.setup({
|
|||||||
ts.load_extension('dap')
|
ts.load_extension('dap')
|
||||||
ts.load_extension('fzf')
|
ts.load_extension('fzf')
|
||||||
ts.load_extension('glyph')
|
ts.load_extension('glyph')
|
||||||
|
ts.load_extension('color_names')
|
||||||
|
ts.load_extension('notify')
|
||||||
|
@ -123,6 +123,7 @@ wk.register({
|
|||||||
f = {
|
f = {
|
||||||
name = "Find File",
|
name = "Find File",
|
||||||
b = "File Browser",
|
b = "File Browser",
|
||||||
|
c = "File Color",
|
||||||
f = "Find in Current Directory",
|
f = "Find in Current Directory",
|
||||||
g = "Live Grep",
|
g = "Live Grep",
|
||||||
r = "File Recent"
|
r = "File Recent"
|
||||||
@ -207,6 +208,13 @@ wk.register({
|
|||||||
P = "Ipython (fullscreen)",
|
P = "Ipython (fullscreen)",
|
||||||
t = "Split Terminal"
|
t = "Split Terminal"
|
||||||
},
|
},
|
||||||
|
T = {
|
||||||
|
name = "Telescope",
|
||||||
|
c = "Color Names",
|
||||||
|
g = "Glyph",
|
||||||
|
n = "Notifications",
|
||||||
|
t = "Telescope"
|
||||||
|
},
|
||||||
w = {
|
w = {
|
||||||
name = "Workspace",
|
name = "Workspace",
|
||||||
a = "Add Folder",
|
a = "Add Folder",
|
||||||
|
Loading…
Reference in New Issue
Block a user