Compare commits

..

No commits in common. 'f214a975aa4e65e56af68cc4151a72fd9f71ea03' and '5c190777dc004aa590d1572cfe53569596e750b1' have entirely different histories.

@ -6,6 +6,8 @@ options = { noremap = true }
-- Navigation -- Navigation
map('n', 'gh', '0', options) -- make gh go to beginning of line map('n', 'gh', '0', options) -- make gh go to beginning of line
map('n', 'gl', '$', options) -- make gl go to end of line map('n', 'gl', '$', options) -- make gl go to end of line
map('n', 'gk', 'gg', options) -- make gk go to top of document
map('n', 'gj', 'G', options) -- make gj go to bottom of document
-- WINDOW MANAGEMENT -- WINDOW MANAGEMENT
@ -38,33 +40,14 @@ map('n', '<leader>q', '<cmd>call ToggleQFList(0)<CR>', {}) -- see plugin/navigat
-- GIT -- GIT
-- top level commands -- top level commands
map('n', '<leader>gs', '<cmd>keepalt Git<CR>', options) -- Show git status map('n', '<leader>gs', '<cmd>G<CR>', options) -- Show git status
map('n', '<leader>gc', '<cmd>G commit -v<CR>', options) -- git commit map('n', '<leader>gc', '<cmd>G commit<CR>', options) -- git commit
map('n', '<leader>gp', '<cmd>G push<CR>', {}) -- git push map('n', '<leader>gp', '<cmd>G push<CR>', {}) -- git push
map('n', '<leader>gd', '<cmd>G diff<CR>', options)
map('n', '<leader>gds', '<cmd>G diff --staged<CR>', options)
-- staging
map('n', '<leader>dp', '<cmd>diffput<CR>', options)
-- merge -- merge
map('n', '<leader>gh', '<cmd>diffget //2<CR>', options) -- merge from left pane map('n', '<leader>gh', '<cmd>diffget //2<CR>', options) -- merge from left pane
map('n', '<leader>gl', '<cmd>diffget //3<CR>', options) -- merge from right pane map('n', '<leader>gl', '<cmd>diffget //3<CR>', options) -- merge from right pane
vim.keymap.set(
"i",
"<Plug>(vimrc:copilot-dummy-map)",
'copilot#Accept("")',
{ silent = true, expr = true, desc = "Copilot dummy accept" }
)
-- remap copilot key to <C-j>
vim.g.copilot_no_tab_map = true
vim.g.copilot_assume_mapped = true
local map = vim.keymap.set
map("i", "<C-j>", "copilot#Accept('<CR>')", {noremap = true, silent = true, expr=true, replace_keycodes = false })
-- LSP -- LSP
-- Use an on_attach function to only map the following keys -- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
@ -83,19 +66,19 @@ local on_attach = function(client, bufnr)
vim.keymap.set('n', '<leader>F', function() vim.lsp.buf.format() end, opts) vim.keymap.set('n', '<leader>F', function() vim.lsp.buf.format() end, opts)
end end
local cmp_mappings = function ()
local cmp = require('cmp') local cmp = require('cmp')
local cmp_select = {behavior = cmp.SelectBehavior.Select} return {
local cmp_mappings = { ['<C-j>'] = cmp.mapping.scroll_docs(4),
['<C-d>'] = cmp.mapping.scroll_docs(4), ['<C-k>'] = cmp.mapping.scroll_docs(-4),
['<C-u>'] = cmp.mapping.scroll_docs(-4),
['<C-Space>'] = cmp.mapping.complete(), ['<C-Space>'] = cmp.mapping.complete(),
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select), ['<C-p>'] = cmp.mapping.select_prev_item(cmp_select),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select), ['<C-n>'] = cmp.mapping.select_next_item(cmp_select),
['<CR>'] = cmp.mapping.confirm({ ['<CR>'] = cmp.mapping.confirm {
behavior = cmp.ConfirmBehavior.Replace, behavior = cmp.ConfirmBehavior.Replace,
select = true, select = true,
}), },
['<C-e>'] = cmp.mapping.abort(),
} }
end
return { on_attach = on_attach, cmp_mappings = cmp_mappings } return { on_attach = on_attach, cmp_mappings = cmp_mappings }

@ -1,7 +1,7 @@
local lsp = require('lsp-zero').preset({ local lsp = require('lsp-zero').preset({
name = 'minimal', name = 'minimal',
set_lsp_keymaps = false, set_lsp_keymaps = false,
manage_nvim_cmp = true, manage_nvim_cmp = false,
suggest_lsp_servers = false, suggest_lsp_servers = false,
}) })
@ -23,9 +23,6 @@ local cmp_config = lsp.defaults.cmp_config({
{ name = 'nvim_lsp' }, { name = 'nvim_lsp' },
{ name = 'luasnip' }, { name = 'luasnip' },
}, },
experimental = {
ghost_text = false -- conflicts with copilot.vim's preview
},
}) })
cmp.setup(cmp_config) cmp.setup(cmp_config)
@ -57,17 +54,6 @@ lsp.configure('html', {
cmd = { "npx", "vscode-html-language-server", "--stdio" }, cmd = { "npx", "vscode-html-language-server", "--stdio" },
}) })
lsp.configure('texlab', { lsp.setup_servers({'tsserver', 'rust_analyzer', 'html'})
forwardSearch = {
executable = 'zathura',
args = { '--synctex-forward', '%l:1:%f', '%p' }
},
})
lsp.configure('clangd', {})
lsp.configure('pylsp', {})
lsp.setup_servers({'tsserver', 'rust_analyzer', 'html', 'texlab', 'clangd', 'pylsp'})
lsp.setup() lsp.setup()

@ -16,22 +16,16 @@ local plugins = require('packer').startup(function(use)
-- git -- git
use 'tpope/vim-fugitive' use 'tpope/vim-fugitive'
use 'https://github.com/airblade/vim-gitgutter'
use { use {
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
run = ':TSUpdate' run = ':TSUpdate'
} }
use {
'https://github.com/github/copilot.vim',
keys = "<C-P>",
}
-- lsp -- lsp
use { use {
'VonHeikemen/lsp-zero.nvim', 'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x', branch = 'v1.x',
requires = { requires = {
-- LSP Support -- LSP Support
{'neovim/nvim-lspconfig'}, {'neovim/nvim-lspconfig'},

@ -1,10 +1,5 @@
require('nvim-treesitter.configs').setup { local parser_config = require "nvim-treesitter.parsers".get_parser_configs()
highlight = { parser_config.hare = {
enable = true,
}
}
require('nvim-treesitter.parsers').get_parser_configs().hare = {
install_info = { install_info = {
url = "https://git.sr.ht/~ecmma/tree-sitter-hare", -- local path or git repo url = "https://git.sr.ht/~ecmma/tree-sitter-hare", -- local path or git repo
files = {"src/parser.c"}, files = {"src/parser.c"},

Loading…
Cancel
Save