mirror of
https://github.com/nvim-lua/kickstart.nvim.git
synced 2025-06-25 14:48:33 +02:00
cmake, neo-tree, cpp and clang support
cmak support, neo-tree, cpp, clang, etc,,,
This commit is contained in:
parent
b6f7005702
commit
897d3c9beb
3 changed files with 59 additions and 12 deletions
42
init.lua
42
init.lua
|
@ -154,6 +154,8 @@ vim.opt.cursorline = true
|
|||
-- Minimal number of screen lines to keep above and below the cursor.
|
||||
vim.opt.scrolloff = 10
|
||||
|
||||
vim.opt.smartindent = true
|
||||
|
||||
-- [[ Basic Keymaps ]]
|
||||
-- See `:help vim.keymap.set()`
|
||||
|
||||
|
@ -190,7 +192,10 @@ vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right win
|
|||
vim.keymap.set('n', '<C-j>', '<C-w><C-j>', { desc = 'Move focus to the lower window' })
|
||||
vim.keymap.set('n', '<C-k>', '<C-w><C-k>', { desc = 'Move focus to the upper window' })
|
||||
|
||||
-- [[ Basic Autocommands ]]
|
||||
-- vim.o.winbar = '%=%m %f'
|
||||
vim.o.winbar = '%f'
|
||||
|
||||
-- [[ Basic Autocommands ]]:
|
||||
-- See `:help lua-guide-autocommands`
|
||||
|
||||
-- Highlight when yanking (copying) text
|
||||
|
@ -207,7 +212,7 @@ vim.api.nvim_create_autocmd('TextYankPost', {
|
|||
-- [[ Install `lazy.nvim` plugin manager ]]
|
||||
-- See `:help lazy.nvim.txt` or https://github.com/folke/lazy.nvim for more info
|
||||
local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
if not vim.uv.fs_stat(lazypath) then
|
||||
local lazyrepo = 'https://github.com/folke/lazy.nvim.git'
|
||||
vim.fn.system { 'git', 'clone', '--filter=blob:none', '--branch=stable', lazyrepo, lazypath }
|
||||
end ---@diagnostic disable-next-line: undefined-field
|
||||
|
@ -255,6 +260,7 @@ require('lazy').setup({
|
|||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
},
|
||||
current_line_blame = true,
|
||||
},
|
||||
},
|
||||
|
||||
|
@ -353,11 +359,14 @@ require('lazy').setup({
|
|||
-- You can put your default mappings / updates / etc. in here
|
||||
-- All the info you're looking for is in `:help telescope.setup()`
|
||||
--
|
||||
-- defaults = {
|
||||
-- mappings = {
|
||||
-- i = { ['<c-enter>'] = 'to_fuzzy_refine' },
|
||||
-- },
|
||||
-- },
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = { ['<c-enter>'] = 'to_fuzzy_refine' },
|
||||
},
|
||||
file_ignore_patterns = {
|
||||
'build/*',
|
||||
},
|
||||
},
|
||||
-- pickers = {}
|
||||
extensions = {
|
||||
['ui-select'] = {
|
||||
|
@ -466,6 +475,12 @@ require('lazy').setup({
|
|||
vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
end
|
||||
|
||||
-- Define the map function with support for arguments
|
||||
local map_with_args = function(keys, func, desc, args)
|
||||
vim.keymap.set('n', keys, function()
|
||||
func(args)
|
||||
end, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
||||
end
|
||||
-- Jump to the definition of the word under your cursor.
|
||||
-- This is where a variable was first declared, or where a function is defined, etc.
|
||||
-- To jump back, press <C-t>.
|
||||
|
@ -485,7 +500,7 @@ require('lazy').setup({
|
|||
|
||||
-- Fuzzy find all the symbols in your current document.
|
||||
-- Symbols are things like variables, functions, types, etc.
|
||||
map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
||||
map_with_args('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols', { fname_width = 0.5, symbol_width = 0.75 })
|
||||
|
||||
-- Fuzzy find all the symbols in your current workspace.
|
||||
-- Similar to document symbols, except searches over your entire project.
|
||||
|
@ -544,6 +559,9 @@ require('lazy').setup({
|
|||
map('<leader>th', function()
|
||||
vim.lsp.inlay_hint.enable(not vim.lsp.inlay_hint.is_enabled())
|
||||
end, '[T]oggle Inlay [H]ints')
|
||||
|
||||
-- enable inlay on by default.
|
||||
vim.lsp.inlay_hint.enable()
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
@ -778,13 +796,15 @@ require('lazy').setup({
|
|||
-- change the command in the config to whatever the name of that colorscheme is.
|
||||
--
|
||||
-- If you want to see what colorschemes are already installed, you can use `:Telescope colorscheme`.
|
||||
'folke/tokyonight.nvim',
|
||||
'catppuccin/nvim',
|
||||
name = 'catppuccin',
|
||||
priority = 1000, -- Make sure to load this before all the other start plugins.
|
||||
init = function()
|
||||
-- Load the colorscheme here.
|
||||
-- Like many other themes, this one has different styles, and you could load
|
||||
-- any other, such as 'tokyonight-storm', 'tokyonight-moon', or 'tokyonight-day'.
|
||||
vim.cmd.colorscheme 'tokyonight-night'
|
||||
-- colorscheme catppuccin " catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha
|
||||
vim.cmd.colorscheme 'catppuccin-mocha'
|
||||
|
||||
-- You can configure highlights by doing something like:
|
||||
vim.cmd.hi 'Comment gui=none'
|
||||
|
@ -876,7 +896,7 @@ require('lazy').setup({
|
|||
-- require 'kickstart.plugins.debug',
|
||||
require 'kickstart.plugins.indent_line',
|
||||
-- require 'kickstart.plugins.lint',
|
||||
-- require 'kickstart.plugins.autopairs',
|
||||
require 'kickstart.plugins.autopairs',
|
||||
require 'kickstart.plugins.neo-tree',
|
||||
require 'kickstart.plugins.gitsigns', -- adds gitsigns recommend keymaps
|
||||
|
||||
|
|
|
@ -2,4 +2,26 @@
|
|||
-- I promise not to create any merge conflicts in this directory :)
|
||||
--
|
||||
-- See the kickstart.nvim README for more information
|
||||
return { 'Civitasv/cmake-tools.nvim' }
|
||||
return {
|
||||
'Civitasv/cmake-tools.nvim',
|
||||
lazy = true,
|
||||
init = function()
|
||||
local loaded = false
|
||||
local function check()
|
||||
local cwd = vim.uv.cwd()
|
||||
if vim.fn.filereadable(cwd .. '/CMakeLists.txt') == 1 then
|
||||
require('lazy').load { plugins = { 'cmake-tools.nvim' } }
|
||||
loaded = true
|
||||
end
|
||||
end
|
||||
check()
|
||||
vim.api.nvim_create_autocmd('DirChanged', {
|
||||
callback = function()
|
||||
if not loaded then
|
||||
check()
|
||||
end
|
||||
end,
|
||||
})
|
||||
end,
|
||||
opts = {},
|
||||
}
|
||||
|
|
|
@ -20,6 +20,11 @@ return {
|
|||
['\\'] = 'close_window',
|
||||
},
|
||||
},
|
||||
filtered_items = {
|
||||
visible = true,
|
||||
hide_dotfiles = false,
|
||||
hide_gitignored = false,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue