Compare commits

...

20 Commits

Author SHA1 Message Date
40d22e9971 Merge remote-tracking branch 'modular/master' 2024-04-22 11:35:18 +02:00
680e5f69c1 disable cmp in comments 2024-04-22 07:57:15 +02:00
Damjan 9000
98134335b8 Merge 'upstream' example of the classic complete keymaps
- Add a commented out example of the classic complete keymaps.
- Minor improvements of debian install instructions.
2024-04-20 20:12:35 +02:00
Damjan 9000
2e68a2c253
Add a commented out example of the classic complete keymaps. Fixes #866 (#868) 2024-04-20 13:14:49 -04:00
Damjan 9000
9f5176fc2a
Minor improvements of debian install instructions. Fixes #859 (#869) 2024-04-20 13:14:24 -04:00
Damjan 9000
77119da941 Merge 'upstream' Update README.md Debian install instructions 2024-04-20 18:03:57 +02:00
Evan Carroll
931ec5c226
Update README.md (#860)
Attempted fix for #859, provide reasonable Debian install instructions -- comment on GitHub issue with refinement.
2024-04-20 11:55:01 -04:00
Damjan 9000
b8b2e88521 Merge 'upstream' fix: restore Mason config timing for DAP startup 2024-04-20 14:05:56 +02:00
GameFuzzy
b07176aef6
fix: restore Mason config timing for DAP startup (again) (#865) 2024-04-19 13:50:42 -04:00
Damjan 9000
517da30837 Merge 'upstream' Add gitsigns recommended keymaps
Note, the upstream base gitsigns config and optional gitsigns plugin are merged
into the same plugin spec, so the gitsigns keymaps are enabled by default.
2024-04-18 11:11:37 +02:00
Damjan 9000
f5c9fe8e15
Add gitsigns recommended keymaps as an optional plugin (#858) 2024-04-17 21:00:39 -04:00
Damjan 9000
3d2daa7965 Merge 'upstream' Move plugin examples from README to optional plugin files 2024-04-17 23:08:09 +02:00
Damjan 9000
5e258d276f
Move plugin examples from README to optional plugin files (#831)
* Move autopairs example from README to an optional plugin

* Move neo-tree example from README to an optional plugin
2024-04-17 15:25:54 -04:00
Damjan 9000
b6b33e61a4 Merge 'upstream' prefer_git, inlay hints
- add prefer_git to treesitter config
- Enable inlay hints for the supporting servers
2024-04-17 20:42:05 +02:00
Vladislav Grechannik
5540527fab
Enable inlay hints for the supporting servers (#843) 2024-04-17 14:04:55 -04:00
Chris Patti
6d6b3f38c1
Fix: #847 - add prefer_git to treesitter config (#856) 2024-04-17 14:02:24 -04:00
Damjan 9000
c0ac446e58 Merge 'upstream' Comment about nerd font selection. 2024-04-17 16:33:32 +02:00
Damjan 9000
fabeb86d8b
Comment about nerd font selection. Fixes #853 (#854) 2024-04-17 09:59:14 -04:00
Damjan 9000
478a830642 Merge 'upstream' README: Arch Install Steps 2024-04-16 17:36:56 +02:00
rdvm
e2bfa0c66f
Arch, btw (#852)
* Arch, btw

* Add unzip

* Add unzip for Fedora and --needed arg for Arch
2024-04-16 11:29:27 -04:00
10 changed files with 105 additions and 39 deletions

View File

@ -169,15 +169,29 @@ sudo apt install make gcc ripgrep unzip git neovim
``` ```
sudo apt update sudo apt update
sudo apt install make gcc ripgrep unzip git sudo apt install make gcc ripgrep unzip git curl
echo "deb https://deb.debian.org/debian unstable main" | sudo tee -a /etc/apt/sources.list
sudo apt update # Now we install nvim
sudo apt install -t unstable neovim curl -LO https://github.com/neovim/neovim/releases/latest/download/nvim-linux64.tar.gz
sudo rm -rf /opt/nvim-linux64
sudo mkdir -p /opt/nvim-linux64
sudo chmod a+rX /opt/nvim-linux64
sudo tar -C /opt -xzf nvim-linux64.tar.gz
# make it available in /usr/local/bin, distro installs to /usr/bin
sudo ln -sf /opt/nvim-linux64/bin/nvim /usr/local/bin/
``` ```
</details> </details>
<details><summary>Fedora Install Steps</summary> <details><summary>Fedora Install Steps</summary>
``` ```
sudo dnf install -y gcc make git ripgrep fd-find neovim sudo dnf install -y gcc make git ripgrep fd-find unzip neovim
```
</details>
<details><summary>Arch Install Steps</summary>
```
sudo pacman -S --noconfirm --needed gcc make git ripgrep fd unzip neovim
``` ```
</details> </details>

View File

@ -3,7 +3,7 @@
vim.g.mapleader = ' ' vim.g.mapleader = ' '
vim.g.maplocalleader = ' ' vim.g.maplocalleader = ' '
-- Set to true if you have a Nerd Font installed -- Set to true if you have a Nerd Font installed and selected in the terminal
vim.g.have_nerd_font = true vim.g.have_nerd_font = true
-- Save start directory as base -- Save start directory as base

View File

@ -1,7 +1,9 @@
-- File: lua/custom/plugins/autopairs.lua -- autopairs
-- https://github.com/windwp/nvim-autopairs
return { return {
'windwp/nvim-autopairs', 'windwp/nvim-autopairs',
event = 'InsertEnter',
-- Optional dependency -- Optional dependency
dependencies = { 'hrsh7th/nvim-cmp' }, dependencies = { 'hrsh7th/nvim-cmp' },
config = function() config = function()

View File

@ -38,6 +38,16 @@ return {
luasnip.config.setup {} luasnip.config.setup {}
cmp.setup { cmp.setup {
enabled = function()
-- disable completion in comments
local context = require 'cmp.config.context'
-- keep command mode completion enabled when cursor is in a comment
if vim.api.nvim_get_mode().mode == 'c' then
return true
else
return not context.in_treesitter_capture 'comment' and not context.in_syntax_group 'Comment'
end
end,
snippet = { snippet = {
expand = function(args) expand = function(args)
luasnip.lsp_expand(args.body) luasnip.lsp_expand(args.body)
@ -60,6 +70,12 @@ return {
['<C-y>'] = cmp.mapping.confirm { select = true }, ['<C-y>'] = cmp.mapping.confirm { select = true },
['<C-n>'] = cmp.mapping.abort(), ['<C-n>'] = cmp.mapping.abort(),
-- If you prefer more traditional completion keymaps,
-- you can uncomment the following lines
--['<CR>'] = cmp.mapping.confirm { select = true },
--['<Tab>'] = cmp.mapping.select_next_item(),
--['<S-Tab>'] = cmp.mapping.select_prev_item(),
-- Manually trigger a completion from nvim-cmp. -- Manually trigger a completion from nvim-cmp.
-- Generally you don't need this, because nvim-cmp will display -- Generally you don't need this, because nvim-cmp will display
-- completions whenever it has completion options available. -- completions whenever it has completion options available.

View File

@ -15,7 +15,7 @@ return {
changedelete = { text = '~' }, changedelete = { text = '~' },
}, },
on_attach = function(bufnr) on_attach = function(bufnr)
local gs = package.loaded.gitsigns local gitsigns = require 'gitsigns'
local function map(mode, l, r, opts) local function map(mode, l, r, opts)
opts = opts or {} opts = opts or {}
@ -24,50 +24,45 @@ return {
end end
-- Navigation -- Navigation
map({ 'n', 'v' }, ']c', function() map('n', ']c', function()
if vim.wo.diff then if vim.wo.diff then
return ']c' vim.cmd.normal { ']c', bang = true }
else
gitsigns.nav_hunk 'next'
end end
vim.schedule(function() end, { desc = 'Jump to next git [c]hange' })
gs.next_hunk()
end)
return '<Ignore>'
end, { expr = true, desc = 'Jump to next hunk' })
map({ 'n', 'v' }, '[c', function() map('n', '[c', function()
if vim.wo.diff then if vim.wo.diff then
return '[c' vim.cmd.normal { '[c', bang = true }
else
gitsigns.nav_hunk 'prev'
end end
vim.schedule(function() end, { desc = 'Jump to previous git [c]hange' })
gs.prev_hunk()
end)
return '<Ignore>'
end, { expr = true, desc = 'Jump to previous hunk' })
-- Actions -- Actions
-- visual mode -- visual mode
map('v', '<leader>hs', function() map('v', '<leader>hs', function()
gs.stage_hunk { vim.fn.line '.', vim.fn.line 'v' } gitsigns.stage_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'stage git hunk' }) end, { desc = 'stage git hunk' })
map('v', '<leader>hr', function() map('v', '<leader>hr', function()
gs.reset_hunk { vim.fn.line '.', vim.fn.line 'v' } gitsigns.reset_hunk { vim.fn.line '.', vim.fn.line 'v' }
end, { desc = 'reset git hunk' }) end, { desc = 'reset git hunk' })
-- normal mode -- normal mode
map('n', '<leader>hs', gs.stage_hunk, { desc = 'git stage hunk' }) map('n', '<leader>hs', gitsigns.stage_hunk, { desc = 'git [s]tage hunk' })
map('n', '<leader>hS', gs.stage_buffer, { desc = 'git Stage buffer' }) map('n', '<leader>hr', gitsigns.reset_hunk, { desc = 'git [r]eset hunk' })
map('n', '<leader>hu', gs.undo_stage_hunk, { desc = 'undo stage hunk' }) map('n', '<leader>hS', gitsigns.stage_buffer, { desc = 'git [S]tage buffer' })
map('n', '<leader>hp', gs.preview_hunk, { desc = 'preview git hunk' }) map('n', '<leader>hu', gitsigns.undo_stage_hunk, { desc = 'git [u]ndo stage hunk' })
map('n', '<leader>hb', function() map('n', '<leader>hR', gitsigns.reset_buffer, { desc = 'git [R]eset buffer' })
gs.blame_line { full = false } map('n', '<leader>hp', gitsigns.preview_hunk, { desc = 'git [p]review hunk' })
end, { desc = 'git blame line' }) map('n', '<leader>hb', gitsigns.blame_line, { desc = 'git [b]lame line' })
map('n', '<leader>hd', gs.diffthis, { desc = 'git diff against index' }) map('n', '<leader>hd', gitsigns.diffthis, { desc = 'git [d]iff against index' })
map('n', '<leader>hD', function() map('n', '<leader>hD', function()
gs.diffthis '~' gitsigns.diffthis '@'
end, { desc = 'git diff against last commit' }) end, { desc = 'git [D]iff against last commit' })
-- Toggles -- Toggles
map('n', '<leader>tb', gs.toggle_current_line_blame, { desc = 'toggle git blame line' }) map('n', '<leader>tb', gitsigns.toggle_current_line_blame, { desc = '[T]oggle git show [b]lame line' })
map('n', '<leader>td', gs.toggle_deleted, { desc = 'toggle git show deleted' }) map('n', '<leader>tD', gitsigns.toggle_deleted, { desc = '[T]oggle git show [D]eleted' })
-- Text object -- Text object
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'select git hunk' }) map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>', { desc = 'select git hunk' })

View File

@ -3,7 +3,7 @@ return {
'neovim/nvim-lspconfig', 'neovim/nvim-lspconfig',
dependencies = { dependencies = {
-- Automatically install LSPs and related tools to stdpath for Neovim -- Automatically install LSPs and related tools to stdpath for Neovim
'williamboman/mason.nvim', { 'williamboman/mason.nvim', config = true }, -- NOTE: Must be loaded before dependants
'williamboman/mason-lspconfig.nvim', 'williamboman/mason-lspconfig.nvim',
'WhoIsSethDaniel/mason-tool-installer.nvim', 'WhoIsSethDaniel/mason-tool-installer.nvim',
@ -118,6 +118,16 @@ return {
callback = vim.lsp.buf.clear_references, callback = vim.lsp.buf.clear_references,
}) })
end end
-- The following autocommand is used to enable inlay hints in your
-- code, if the language server you are using supports them
--
-- This may be unwanted, since they displace some of your code
if client and client.server_capabilities.inlayHintProvider and vim.lsp.inlay_hint then
map('<leader>th', function()
vim.lsp.inlay_hint.enable(0, not vim.lsp.inlay_hint.is_enabled())
end, '[T]oggle Inlay [H]ints')
end
end, end,
}) })

View File

@ -0,0 +1,25 @@
-- Neo-tree is a Neovim plugin to browse the file system
-- https://github.com/nvim-neo-tree/neo-tree.nvim
return {
'nvim-neo-tree/neo-tree.nvim',
version = '*',
dependencies = {
'nvim-lua/plenary.nvim',
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
'MunifTanjim/nui.nvim',
},
cmd = 'Neotree',
keys = {
{ '\\', ':Neotree reveal<CR>', { desc = 'NeoTree reveal' } },
},
opts = {
filesystem = {
window = {
mappings = {
['\\'] = 'close_window',
},
},
},
},
}

View File

@ -100,6 +100,8 @@ return {
config = function(_, opts) config = function(_, opts)
-- [[ Configure Treesitter ]] See `:help nvim-treesitter` -- [[ Configure Treesitter ]] See `:help nvim-treesitter`
-- Prefer git instead of curl in order to improve connectivity in some environments
require('nvim-treesitter.install').prefer_git = true
---@diagnostic disable-next-line: missing-fields ---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter.configs').setup(opts) require('nvim-treesitter.configs').setup(opts)
end, end,

View File

@ -30,7 +30,7 @@ return {
['<leader>c'] = { name = '[C]ode/[C]odeium/[C]hange', _ = 'which_key_ignore' }, ['<leader>c'] = { name = '[C]ode/[C]odeium/[C]hange', _ = 'which_key_ignore' },
['<leader>cd'] = { name = '[D]irectory', _ = 'which_key_ignore' }, ['<leader>cd'] = { name = '[D]irectory', _ = 'which_key_ignore' },
['<leader>d'] = { name = '[D]ocument/[D]elete', _ = 'which_key_ignore' }, ['<leader>d'] = { name = '[D]ocument/[D]elete', _ = 'which_key_ignore' },
['<leader>h'] = { name = '[H]unk/[H]arpoon', _ = 'which_key_ignore' }, ['<leader>h'] = { name = 'Git [H]unk/[H]arpoon', _ = 'which_key_ignore' },
['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' }, ['<leader>t'] = { name = '[T]oggle', _ = 'which_key_ignore' },
['<leader>dn'] = { name = '[N]o', _ = 'which_key_ignore' }, ['<leader>dn'] = { name = '[N]o', _ = 'which_key_ignore' },
} }

View File

@ -69,6 +69,8 @@ require('lazy').setup({
require 'kickstart.plugins.debug', require 'kickstart.plugins.debug',
require 'kickstart.plugins.indent_line', require 'kickstart.plugins.indent_line',
require 'kickstart.plugins.lint', require 'kickstart.plugins.lint',
require 'kickstart.plugins.autopairs',
-- require 'kickstart.plugins.neo-tree',
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua` -- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
-- This is the easiest way to modularize your config. -- This is the easiest way to modularize your config.