Skip to content

Commit cc7917b

Browse files
committed
feat: updated to the latest nvim-lua/kickstart.nvim
1 parent 3338d39 commit cc7917b

35 files changed

Lines changed: 1678 additions & 21 deletions

after/ftplugin/haskell.lua

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
-- local ht = require 'haskell-tools'
2+
-- local bufnr = vim.api.nvim_get_current_buf()
3+
-- local base_opts = { noremap = true, silent = true, buffer = bufnr }
4+
--
5+
-- vim.keymap.set('n', '<space>cl', vim.lsp.codelens.run, vim.tbl_extend('force', base_opts, { desc = 'Run all code lenses (e.g. eval, add signature)' }))
6+
--
7+
-- vim.keymap.set('n', '<space>hs', ht.hoogle.hoogle_signature, vim.tbl_extend('force', base_opts, { desc = 'Hoogle search for type signature under cursor' }))
8+
--
9+
-- vim.keymap.set('n', '<space>ea', ht.lsp.buf_eval_all, vim.tbl_extend('force', base_opts, { desc = 'Evaluate all code snippets in buffer' }))
10+
--
11+
-- vim.keymap.set('n', '<leader>rr', ht.repl.toggle, vim.tbl_extend('force', base_opts, { desc = 'Toggle GHCi repl for current package' }))
12+
--
13+
-- vim.keymap.set('n', '<leader>rf', function()
14+
-- ht.repl.toggle(vim.api.nvim_buf_get_name(0))
15+
-- end, vim.tbl_extend('force', base_opts, { desc = 'Toggle GHCi repl for current buffer' }))
16+
--
17+
-- vim.keymap.set('n', '<leader>rq', ht.repl.quit, vim.tbl_extend('force', base_opts, { desc = 'Quit GHCi repl' }))

after/ftplugin/markdown.lua

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
-- Add the key mappings only for Markdown files in a zk notebook.
2+
if require('zk.util').notebook_root(vim.fn.expand '%:p') ~= nil then
3+
local function map(...)
4+
vim.api.nvim_buf_set_keymap(0, ...)
5+
end
6+
local opts = { noremap = true, silent = false }
7+
8+
-- Open the link under the caret.
9+
map('n', '<CR>', '<Cmd>lua vim.lsp.buf.definition()<CR>', opts)
10+
11+
-- Create a new note after asking for its title.
12+
-- This overrides the global `<leader>zn` mapping to create the note in the same directory as the current buffer.
13+
map('n', '<leader>zn', "<Cmd>ZkNew { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>", opts)
14+
-- Create a new note in the same directory as the current buffer, using the current selection for title.
15+
map('v', '<leader>znt', ":'<,'>ZkNewFromTitleSelection { dir = vim.fn.expand('%:p:h') }<CR>", opts)
16+
-- Create a new note in the same directory as the current buffer, using the current selection for note content and asking for its title.
17+
map('v', '<leader>znc', ":'<,'>ZkNewFromContentSelection { dir = vim.fn.expand('%:p:h'), title = vim.fn.input('Title: ') }<CR>", opts)
18+
19+
-- Open notes linking to the current buffer.
20+
map('n', '<leader>zb', '<Cmd>ZkBacklinks<CR>', opts)
21+
-- Alternative for backlinks using pure LSP and showing the source context.
22+
--map('n', '<leader>zb', '<Cmd>lua vim.lsp.buf.references()<CR>', opts)
23+
-- Open notes linked by the current buffer.
24+
map('n', '<leader>zl', '<Cmd>ZkLinks<CR>', opts)
25+
26+
-- Preview a linked note.
27+
map('n', 'K', '<Cmd>lua vim.lsp.buf.hover()<CR>', opts)
28+
-- Open the code actions for a visual selection.
29+
map('v', '<leader>za', ":'<,'>lua vim.lsp.buf.range_code_action()<CR>", opts)
30+
31+
-- Insert a link to a note.
32+
map('n', '<leader>zi', '<Cmd>ZkInsertLink<CR>', opts)
33+
-- Insert a link to a note using the current selection for the link text.
34+
map('v', '<leader>zil', ":'<,'>ZkInsertLinkAtSelection<CR>", opts)
35+
end

after/ftplugin/rust.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
local bufnr = vim.api.nvim_get_current_buf()
2+
vim.keymap.set('n', '<leader>a', function()
3+
vim.cmd.RustLsp 'codeAction' -- supports rust-analyzer's grouping
4+
-- or vim.lsp.buf.codeAction() if you don't want grouping.
5+
end, { silent = true, buffer = bufnr })
6+
vim.keymap.set(
7+
'n',
8+
'K', -- Override Neovim's built-in hover keymap with rustaceanvim's hover actions
9+
function()
10+
vim.cmd.RustLsp { 'hover', 'actions' }
11+
end,
12+
{ silent = true, buffer = bufnr }
13+
)

init.lua

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -361,6 +361,7 @@ require('lazy').setup({
361361
{ -- Fuzzy Finder (files, lsp, etc)
362362
'nvim-telescope/telescope.nvim',
363363
event = 'VimEnter',
364+
tag = 'v0.2.0',
364365
dependencies = {
365366
'nvim-lua/plenary.nvim',
366367
{ -- If encountering errors, see telescope-fzf-native README for installation instructions
@@ -941,21 +942,13 @@ require('lazy').setup({
941942
{ -- Highlight, edit, and navigate code
942943
'nvim-treesitter/nvim-treesitter',
943944
build = ':TSUpdate',
944-
main = 'nvim-treesitter.configs', -- Sets main module to use for opts
945945
-- [[ Configure Treesitter ]] See `:help nvim-treesitter`
946-
opts = {
947-
ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
948-
-- Autoinstall languages that are not installed
949-
auto_install = true,
950-
highlight = {
951-
enable = true,
952-
-- Some languages depend on vim's regex highlighting system (such as Ruby) for indent rules.
953-
-- If you are experiencing weird indenting issues, add the language to
954-
-- the list of additional_vim_regex_highlighting and disabled languages for indent.
955-
additional_vim_regex_highlighting = { 'ruby' },
956-
},
957-
indent = { enable = true, disable = { 'ruby' } },
958-
},
946+
config = function()
947+
local ts = require 'nvim-treesitter'
948+
ts.setup {}
949+
ts.install({ 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }):wait(30000)
950+
end,
951+
959952
-- There are additional nvim-treesitter modules that you can use to interact
960953
-- with nvim-treesitter. You should go explore a few and see what interests you:
961954
--
@@ -973,18 +966,18 @@ require('lazy').setup({
973966
-- Here are some example plugins that I've included in the Kickstart repository.
974967
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
975968
--
976-
-- require 'kickstart.plugins.debug',
977-
-- require 'kickstart.plugins.indent_line',
978-
-- require 'kickstart.plugins.lint',
979-
-- require 'kickstart.plugins.autopairs',
980-
-- require 'kickstart.plugins.neo-tree',
981-
-- require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
969+
require 'kickstart.plugins.debug',
970+
require 'kickstart.plugins.indent_line',
971+
require 'kickstart.plugins.lint',
972+
require 'kickstart.plugins.autopairs',
973+
require 'kickstart.plugins.neo-tree',
974+
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
982975

983976
-- NOTE: The import below can automatically add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
984977
-- This is the easiest way to modularize your config.
985978
--
986979
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
987-
-- { import = 'custom.plugins' },
980+
{ import = 'custom.plugins' },
988981
--
989982
-- For additional information with loading, sourcing and examples see `:help lazy.nvim-🔌-plugin-spec`
990983
-- Or use telescope!

lua/custom/plugins/amp.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
return {
2+
'sourcegraph/amp.nvim',
3+
branch = 'main',
4+
lazy = false,
5+
opts = { auto_start = true, log_level = 'info' },
6+
}

0 commit comments

Comments
 (0)