feat: uplift nvim
Signed-off-by: Lucas Sta Maria <lucas@priime.dev>
This commit is contained in:
parent
5619e9b217
commit
67c0e020a2
9 changed files with 183 additions and 45 deletions
1
.config/nvim/lua/git.lua
Normal file
1
.config/nvim/lua/git.lua
Normal file
|
@ -0,0 +1 @@
|
|||
local neogit = require("neogit")
|
|
@ -5,62 +5,62 @@ local cmp_ultisnips_mappings = require("cmp_nvim_ultisnips.mappings")
|
|||
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
end,
|
||||
expand = function(args)
|
||||
vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
|
||||
end,
|
||||
},
|
||||
window = {
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
completion = cmp.config.window.bordered(),
|
||||
documentation = cmp.config.window.bordered(),
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<Tab>"] = cmp.mapping(
|
||||
function(fallback)
|
||||
cmp_ultisnips_mappings.expand_or_jump_forwards(fallback)
|
||||
end
|
||||
),
|
||||
['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.abort(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = false }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
|
||||
["<Tab>"] = cmp.mapping(
|
||||
function(fallback)
|
||||
cmp_ultisnips_mappings.expand_or_jump_forwards(fallback)
|
||||
end
|
||||
),
|
||||
}),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'ultisnips' }, -- For ultisnips users.
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'ultisnips' }, -- For ultisnips users.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
-- Set configuration for specific filetype.
|
||||
cmp.setup.filetype('gitcommit', {
|
||||
-- Set configuration for specific filetype.
|
||||
cmp.setup.filetype('gitcommit', {
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
|
||||
{ name = 'cmp_git' }, -- You can specify the `cmp_git` source if you were installed it.
|
||||
}, {
|
||||
{ name = 'buffer' },
|
||||
{ name = 'buffer' },
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline('/', {
|
||||
-- Use buffer source for `/` (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline('/', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = {
|
||||
{ name = 'buffer' }
|
||||
{ name = 'buffer' }
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(':', {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = 'path' }
|
||||
{ name = 'path' }
|
||||
}, {
|
||||
{ name = 'cmdline' }
|
||||
{ name = 'cmdline' }
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
local capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities())
|
||||
|
||||
local on_attach = function(client, bufnr)
|
||||
local opts = { noremap = true, silent = true }
|
||||
|
@ -129,9 +129,24 @@ lspconfig.tsserver.setup {
|
|||
lspconfig.java_language_server.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
cmd = { "/usr/share/java/java-language-server/lang_server_linux.sh" }
|
||||
cmd = { "/usr/share/java/java-language-server/lang_server_linux.sh" },
|
||||
root_dir = lspconfig.util.root_pattern('*.iml', '.idea', 'build.xml', 'pom.xml', 'settings.gradle',
|
||||
'settings.gradle.kts')
|
||||
}
|
||||
|
||||
--lspconfig.jdtls.setup {
|
||||
-- on_attach = on_attach,
|
||||
-- capabilities = capabilities,
|
||||
-- root_dir = lspconfig.util.root_pattern(
|
||||
-- 'build.xml',
|
||||
-- 'pom.xml',
|
||||
-- 'settings.gradle',
|
||||
-- 'settings.gradle.kts',
|
||||
-- '*.iml',
|
||||
-- '.idea'
|
||||
-- )
|
||||
--}
|
||||
|
||||
lspconfig.racket_langserver.setup {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
|
|
|
@ -8,7 +8,9 @@ local function map(mode, lhs, rhs, opts)
|
|||
end
|
||||
|
||||
-- open terminal
|
||||
map("n", "<leader>ot", ":ToggleTerm<CR>")
|
||||
map("n", "<leader>ott", ":ToggleTerm<CR>")
|
||||
map("n", "<leader>otf", ":ToggleTerm direction=float<CR>")
|
||||
map("n", "<leader>otv", ":ToggleTerm direction=vertical<CR>")
|
||||
|
||||
-- exit terminal mode
|
||||
map("t", "<esc>", "<C-\\><C-n>")
|
||||
|
@ -23,3 +25,13 @@ map("n", "<leader>tg", ":Telescope live_grep<CR>")
|
|||
|
||||
-- copilot
|
||||
map('i', '<C-a>', 'copilot#Accept("<CR>")', {expr=true, silent=true})
|
||||
|
||||
-- neogit
|
||||
map('n', '<leader>gg', ':Neogit<CR>')
|
||||
|
||||
-- symbols outline
|
||||
map("n", "<leader>os", ":SymbolsOutline<CR>")
|
||||
|
||||
-- leap
|
||||
map("n", "<C-s>", ":lua require('leap').leap {}<CR>")
|
||||
map("n", "<C-z>", ":lua require('leap').leap { backward = true }<CR>")
|
||||
|
|
11
.config/nvim/lua/neovide.lua
Normal file
11
.config/nvim/lua/neovide.lua
Normal file
|
@ -0,0 +1,11 @@
|
|||
vim.opt.guifont = { "Source Code Pro", ":h10"}
|
||||
|
||||
vim.g.neovide_hide_mouse_when_typing = true
|
||||
|
||||
vim.g.neovide_refresh_rate = 60
|
||||
vim.g.neovide_refresh_rate_idle = 5
|
||||
|
||||
vim.g.neovide_remember_window_size = false
|
||||
|
||||
vim.g.neovide_cursor_animation_length=0.08
|
||||
vim.g.neovide_cursor_trail_size = 0.6
|
|
@ -13,6 +13,8 @@ packer.startup(function()
|
|||
use("neovim/nvim-lspconfig")
|
||||
use("j-hui/fidget.nvim")
|
||||
use("onsails/lspkind-nvim")
|
||||
use("wlangstroth/vim-racket")
|
||||
use("Olical/conjure")
|
||||
|
||||
-- ui
|
||||
use("ayu-theme/ayu-vim")
|
||||
|
@ -22,7 +24,8 @@ packer.startup(function()
|
|||
use("kyazdani42/nvim-web-devicons")
|
||||
use("kyazdani42/nvim-tree.lua")
|
||||
use("nvim-lualine/lualine.nvim")
|
||||
use("akinsho/toggleterm.nvim")
|
||||
use{"akinsho/toggleterm.nvim",branch="main"}
|
||||
use("simrat39/symbols-outline.nvim")
|
||||
|
||||
-- completion
|
||||
use("hrsh7th/cmp-nvim-lsp")
|
||||
|
@ -39,6 +42,9 @@ packer.startup(function()
|
|||
use("davidgranstrom/nvim-markdown-preview")
|
||||
use("folke/todo-comments.nvim")
|
||||
use("lervag/vimtex")
|
||||
use("TimUntersberger/neogit")
|
||||
use("ggandor/leap.nvim")
|
||||
use("eraserhd/parinfer-rust")
|
||||
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
|
@ -132,10 +138,16 @@ vim.cmd[[
|
|||
]]
|
||||
|
||||
-- todo-comments
|
||||
require('todo-comments').setup {}
|
||||
-- require('todo-comments').setup {}
|
||||
|
||||
-- copilot
|
||||
vim.g.copilot_filetypes = {
|
||||
['*'] = false,
|
||||
['java'] = true,
|
||||
}
|
||||
|
||||
-- symbols-outline
|
||||
require('symbols-outline').setup {}
|
||||
|
||||
-- leap
|
||||
require('leap').setup {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue