Skip to content

Commit

Permalink
feat:add gitlinker plugin to vscode neovim config
Browse files Browse the repository at this point in the history
  • Loading branch information
beardnick committed Dec 24, 2023
1 parent 4c33ba5 commit de777e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
17 changes: 12 additions & 5 deletions vim/my.nvim/vscode/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ local map = vim.keymap.set;
local mapopt = { noremap = true, silent = true }
local vscode = require("vscode-neovim")

vim.notify = vscode.notify

-- {{{ flash

require('flash').setup(
Expand All @@ -20,7 +22,7 @@ require('flash').setup(
}
)

map('n', 's',require('flash').jump, mapopt)
map('n', 's', require('flash').jump, mapopt)

vim.api.nvim_set_hl(0, "FlashLabel", { ctermbg = 0, bg = '#fa036a' })
vim.api.nvim_set_hl(0, "FlashMatch", { ctermbg = 0, bg = '#2f50cd' })
Expand All @@ -30,13 +32,20 @@ vim.api.nvim_set_hl(0, "FlashCurrent", { ctermbg = 0, bg = '#2f50cd' })

-- {{{ quick scope

vim.cmd[[
vim.cmd [[
highlight QuickScopePrimary guifg='#afff5f' gui=underline ctermfg=155 cterm=underline
highlight QuickScopeSecondary guifg='#5fffff' gui=underline ctermfg=81 cterm=underline
]]

--}}}

-- {{{ gitlinker

map('n', '<leader>gl', '<cmd>lua require"gitlinker".get_buf_range_url("n")<cr>', { silent = true })
map('v', '<leader>gl', '<cmd>lua require"gitlinker".get_buf_range_url("v")<cr>', {})

--}}}

--{{{ vim options

vim.o.ignorecase = true
Expand All @@ -46,17 +55,15 @@ vim.o.ignorecase = true
--{{{ functions

function maximize_editor()

vscode.call("workbench.action.closeSidebar")
vscode.call("workbench.action.closePanel")

end

--}}}

--{{{ mapping

map('n', '<leader>wm',maximize_editor, mapopt)
map('n', '<leader>wm', maximize_editor, mapopt)
--map('n', '<C-a>',function vscode.call("workbench.action.focusLastEditorGroup") end, mapopt)
--map('n', '<C-p>',function() vscode.call("workbench.action.quickOpen") end, mapopt)
--map('n', '<leader>ws','<C-w>s', mapopt)
Expand Down
2 changes: 2 additions & 0 deletions vim/my.nvim/vscode/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ call plug#begin(g:plugin_dir)
Plug 'unblevable/quick-scope'
Plug 'folke/flash.nvim', {'branch': 'main'}
Plug 'tpope/vim-surround'
Plug 'ruifm/gitlinker.nvim'
Plug 'nvim-lua/plenary.nvim'

call plug#end()

Expand Down

0 comments on commit de777e4

Please sign in to comment.