Skip to content

Commit fb19a27

Browse files
committed
Merge upstream kickstart.nvim changes & change tmux-sessionizer keybind
* Change to Mason's new address (nvim-lua#1516) * feat: switch vim-sleuth for guess-indent.nvim (nvim-lua#1512) * Replace vim.opt with vim.o (nvim-lua#1495) * don't lazy-load neo-tree so netrw hijacking on startup works (nvim-lua#1489) * README: mention fd-find in requirements (nvim-lua#1477) * fix: rename vim.highlight.on_yank to vim.hl.on_yank (nvim-lua#1482) * Update remaining Mason's old address (nvim-lua#1530)
1 parent 29986d9 commit fb19a27

File tree

8 files changed

+42
-33
lines changed

8 files changed

+42
-33
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ If you are experiencing issues, please make sure you have the latest versions.
2323

2424
External Requirements:
2525
- Basic utils: `git`, `make`, `unzip`, C Compiler (`gcc`)
26-
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation)
26+
- [ripgrep](https://github.com/BurntSushi/ripgrep#installation),
27+
[fd-find](https://github.com/sharkdp/fd#installation)
2728
- Clipboard tool (xclip/xsel/win32yank or other depending on platform)
2829
- A [Nerd Font](https://www.nerdfonts.com/): optional, provides various icons
2930
- if you have it set `vim.g.have_nerd_font` in `init.lua` to true

init.lua

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -94,72 +94,77 @@ vim.g.maplocalleader = ' '
9494
vim.g.have_nerd_font = true
9595

9696
-- [[ Setting options ]]
97-
-- See `:help vim.opt`
97+
-- See `:help vim.o`
9898
-- NOTE: You can change these options as you wish!
9999
-- For more options, you can see `:help option-list`
100100

101101
-- Make line numbers default
102-
vim.opt.number = true
102+
vim.o.number = true
103103
-- You can also add relative line numbers, to help with jumping.
104104
-- Experiment for yourself to see if you like it!
105-
vim.opt.relativenumber = true
105+
vim.o.relativenumber = true
106106

107107
-- Enable mouse mode, can be useful for resizing splits for example!
108-
vim.opt.mouse = 'a'
108+
vim.o.mouse = 'a'
109109

110110
-- Don't show the mode, since it's already in the status line
111-
vim.opt.showmode = false
111+
vim.o.showmode = false
112112

113113
-- Sync clipboard between OS and Neovim.
114114
-- Schedule the setting after `UiEnter` because it can increase startup-time.
115115
-- Remove this option if you want your OS clipboard to remain independent.
116116
-- See `:help 'clipboard'`
117117
vim.schedule(function()
118-
vim.opt.clipboard = 'unnamedplus'
118+
vim.o.clipboard = 'unnamedplus'
119119
end)
120120

121121
-- Enable break indent
122-
vim.opt.breakindent = true
122+
vim.o.breakindent = true
123123

124124
-- Save undo history
125-
vim.opt.undofile = true
125+
vim.o.undofile = true
126126

127127
-- Case-insensitive searching UNLESS \C or one or more capital letters in the search term
128-
vim.opt.ignorecase = true
129-
vim.opt.smartcase = true
128+
vim.o.ignorecase = true
129+
vim.o.smartcase = true
130130

131131
-- Keep signcolumn on by default
132-
vim.opt.signcolumn = 'yes'
132+
vim.o.signcolumn = 'yes'
133133

134134
-- Decrease update time
135-
vim.opt.updatetime = 250
135+
vim.o.updatetime = 250
136136

137137
-- Decrease mapped sequence wait time
138-
vim.opt.timeoutlen = 300
138+
vim.o.timeoutlen = 300
139139

140140
-- Configure how new splits should be opened
141-
vim.opt.splitright = true
142-
vim.opt.splitbelow = true
141+
vim.o.splitright = true
142+
vim.o.splitbelow = true
143143

144144
-- Sets how neovim will display certain whitespace characters in the editor.
145145
-- See `:help 'list'`
146146
-- and `:help 'listchars'`
147-
vim.opt.list = true
147+
--
148+
-- Notice listchars is set using `vim.opt` instead of `vim.o`.
149+
-- It is very similar to `vim.o` but offers an interface for conveniently interacting with tables.Add commentMore actions
150+
-- See `:help lua-options`
151+
-- and `:help lua-options-guide`
152+
vim.o.list = true
148153
vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '' }
149154

150155
-- Preview substitutions live, as you type!
151-
vim.opt.inccommand = 'split'
156+
vim.o.inccommand = 'split'
152157

153158
-- Show which line your cursor is on
154-
vim.opt.cursorline = true
159+
vim.o.cursorline = true
155160

156161
-- Minimal number of screen lines to keep above and below the cursor.
157-
vim.opt.scrolloff = 10
162+
vim.o.scrolloff = 10
158163

159164
-- if performing an operation that would fail due to unsaved changes in the buffer (like `:q`),
160165
-- instead raise a dialog asking if you wish to save the current file(s)
161166
-- See `:help 'confirm'`
162-
vim.opt.confirm = true
167+
vim.o.confirm = true
163168

164169
require 'config.keymaps'
165170

@@ -168,12 +173,12 @@ require 'config.keymaps'
168173

169174
-- Highlight when yanking (copying) text
170175
-- Try it with `yap` in normal mode
171-
-- See `:help vim.highlight.on_yank()`
176+
-- See `:help vim.hl.on_yank()`
172177
vim.api.nvim_create_autocmd('TextYankPost', {
173178
desc = 'Highlight when yanking (copying) text',
174179
group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
175180
callback = function()
176-
vim.highlight.on_yank()
181+
vim.hl.on_yank()
177182
end,
178183
})
179184

@@ -182,7 +187,7 @@ require 'config.lazy'
182187
vim.keymap.set('n', '<leader>ul', '<cmd>Lazy<CR>', { desc = 'Lazy' })
183188
--
184189
-- Quick shortcut to launch tmux-sessionizer
185-
vim.keymap.set('n', '<C-f>', '<cmd>silent !tmux neww tmux-sessionizer<CR>', { desc = 'Launch tmux-sessionizer' })
190+
vim.keymap.set('n', '<C-g>', '<cmd>silent !tmux neww tmux-sessionizer<CR>', { desc = 'Launch tmux-sessionizer' })
186191

187192
-- The line beneath this is called `modeline`. See `:help modeline`
188193
-- vim: ts=2 sts=2 sw=2 et

lua/config/lazy.lua

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,11 @@ if not (vim.uv or vim.loop).fs_stat(lazypath) then
77
if vim.v.shell_error ~= 0 then
88
error('Error cloning lazy.nvim:\n' .. out)
99
end
10-
end ---@diagnostic disable-next-line: undefined-field
11-
vim.opt.rtp:prepend(lazypath)
10+
end
11+
12+
---@type vim.Option
13+
local rtp = vim.opt.rtp
14+
rtp:prepend(lazypath)
1215

1316
-- [[ Configure and install plugins ]]
1417
--
@@ -23,7 +26,7 @@ vim.opt.rtp:prepend(lazypath)
2326
-- NOTE: Here is where you install your plugins.
2427
require('lazy').setup({
2528
-- NOTE: Plugins can be added with a link (or for a github repo: 'owner/repo' link).
26-
'tpope/vim-sleuth', -- Detect tabstop and shiftwidth automatically
29+
'NMAC427/guess-indent.nvim', -- Detect tabstop and shiftwidth automatically
2730

2831
-- NOTE: Plugins can also be added by using a table,
2932
-- with the first argument being the link and the following

lua/kickstart/plugins/debug.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ return {
1818
'nvim-neotest/nvim-nio',
1919

2020
-- Installs the debug adapters for you
21-
'williamboman/mason.nvim',
21+
'mason-org/mason.nvim',
2222
'jay-babu/mason-nvim-dap.nvim',
2323

2424
-- Add your own debuggers here

lua/kickstart/plugins/lint.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ return {
5050
-- Only run the linter in buffers that you can modify in order to
5151
-- avoid superfluous noise, notably within the handy LSP pop-ups that
5252
-- describe the hovered symbol using Markdown.
53-
if vim.opt_local.modifiable:get() then
53+
if vim.bo.modifiable then
5454
lint.try_lint()
5555
end
5656
end,

lua/kickstart/plugins/lspconfig.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ return {
1919
-- Automatically install LSPs and related tools to stdpath for Neovim
2020
-- Mason must be loaded before its dependents so we need to set it up here.
2121
-- NOTE: `opts = {}` is the same as calling `require('mason').setup({})`
22-
{ 'williamboman/mason.nvim', keys = { { '<leader>um', '<cmd>Mason<cr>', desc = 'Mason' } }, opts = {} },
23-
'williamboman/mason-lspconfig.nvim',
22+
{ 'mason-org/mason.nvim', keys = { { '<leader>um', '<cmd>Mason<cr>', desc = 'Mason' } }, opts = {} },
23+
'mason-org/mason-lspconfig.nvim',
2424
'WhoIsSethDaniel/mason-tool-installer.nvim',
2525

2626
-- Useful status updates for LSP.

lua/kickstart/plugins/neo-tree.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ return {
99
'nvim-tree/nvim-web-devicons', -- not strictly required, but recommended
1010
'MunifTanjim/nui.nvim',
1111
},
12-
cmd = 'Neotree',
12+
lazy = false,
1313
keys = {
1414
{ '\\', ':Neotree reveal<CR>', desc = 'NeoTree reveal', silent = true },
1515
},

lua/kickstart/plugins/which-key.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ return {
44
event = 'VimEnter', -- Sets the loading event to 'VimEnter'
55
opts = {
66
-- delay between pressing a key and opening which-key (milliseconds)
7-
-- this setting is independent of vim.opt.timeoutlen
7+
-- this setting is independent of vim.o.timeoutlen
88
delay = 150,
99
icons = {
1010
-- set icon mappings to true if you have a Nerd Font

0 commit comments

Comments
 (0)