|
@@ -1 +1,866 @@
|
|
|
-require("msc")
|
|
|
+
|
|
|
+
|
|
|
+=====================================================================
|
|
|
+==================== READ THIS BEFORE CONTINUING ====================
|
|
|
+=====================================================================
|
|
|
+======== .
|
|
|
+======== .
|
|
|
+======== |.-""""""""""""""""""-.| |
|
|
|
+======== || || | === | ========
|
|
|
+======== || KICKSTART.NVIM || |
|
|
|
+======== || || | === | ========
|
|
|
+======== || || |
|
|
|
+======== ||:Tutor || |:::::| ========
|
|
|
+======== |'-..................-'| |____o| ========
|
|
|
+======== `"")
|
|
|
+======== /::::::::::| |::::::::::\ \ no mouse \ ========
|
|
|
+======== /:::========| |==hjkl==:::\ \ required \ ========
|
|
|
+======== '""""""""""""' '""""""""""""' '""""""""""' ========
|
|
|
+======== ========
|
|
|
+=====================================================================
|
|
|
+=====================================================================
|
|
|
+
|
|
|
+What is Kickstart?
|
|
|
+
|
|
|
+ Kickstart.nvim is *not* a distribution.
|
|
|
+
|
|
|
+ Kickstart.nvim is a starting point for your own configuration.
|
|
|
+ The goal is that you can read every line of code, top-to-bottom, understand
|
|
|
+ what your configuration is doing, and modify it to suit your needs.
|
|
|
+
|
|
|
+ Once you've done that, you can start exploring, configuring and tinkering to
|
|
|
+ make Neovim your own! That might mean leaving Kickstart just the way it is for a while
|
|
|
+ or immediately breaking it into modular pieces. It's up to you!
|
|
|
+
|
|
|
+ If you don't know anything about Lua, I recommend taking some time to read through
|
|
|
+ a guide. One possible example which will only take 10-15 minutes:
|
|
|
+ - https://learnxinyminutes.com/docs/lua/
|
|
|
+
|
|
|
+ After understanding a bit more about Lua, you can use `:help lua-guide` as a
|
|
|
+ reference for how Neovim integrates Lua.
|
|
|
+ - :help lua-guide
|
|
|
+ - (or HTML version): https://neovim.io/doc/user/lua-guide.html
|
|
|
+
|
|
|
+Kickstart Guide:
|
|
|
+
|
|
|
+ TODO: The very first thing you should do is to run the command `:Tutor` in Neovim.
|
|
|
+
|
|
|
+ If you don't know what this means, type the following:
|
|
|
+ - <escape key>
|
|
|
+ - :
|
|
|
+ - Tutor
|
|
|
+ - <enter key>
|
|
|
+
|
|
|
+ (If you already know the Neovim basics, you can skip this step.)
|
|
|
+
|
|
|
+ Once you've completed that, you can continue working through **AND READING** the rest
|
|
|
+ of the kickstart init.lua.
|
|
|
+
|
|
|
+ Next, run AND READ `:help`.
|
|
|
+ This will open up a help window with some basic information
|
|
|
+ about reading, navigating and searching the builtin help documentation.
|
|
|
+
|
|
|
+ This should be the first place you go to look when you're stuck or confused
|
|
|
+ with something. It's one of my favorite Neovim features.
|
|
|
+
|
|
|
+ MOST IMPORTANTLY, we provide a keymap "<space>sh" to [s]earch the [h]elp documentation,
|
|
|
+ which is very useful when you're not exactly sure of what you're looking for.
|
|
|
+
|
|
|
+ I have left several `:help X` comments throughout the init.lua
|
|
|
+ These are hints about where to find more information about the relevant settings,
|
|
|
+ plugins or Neovim features used in Kickstart.
|
|
|
+
|
|
|
+ NOTE: Look for lines like this
|
|
|
+
|
|
|
+ Throughout the file. These are for you, the reader, to help you understand what is happening.
|
|
|
+ Feel free to delete them once you know what you're doing, but they should serve as a guide
|
|
|
+ for when you are first encountering a few different constructs in your Neovim config.
|
|
|
+
|
|
|
+If you experience any errors while trying to install kickstart, run `:checkhealth` for more info.
|
|
|
+
|
|
|
+I hope you enjoy your Neovim journey,
|
|
|
+- TJ
|
|
|
+
|
|
|
+P.S. You can delete this when you're done too. It's your config now! :)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+vim.g.mapleader = ' '
|
|
|
+vim.g.maplocalleader = ' '
|
|
|
+
|
|
|
+
|
|
|
+vim.g.have_nerd_font = false
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.number = true
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.mouse = 'a'
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.showmode = false
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.clipboard = 'unnamedplus'
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.breakindent = true
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.undofile = true
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.ignorecase = true
|
|
|
+vim.opt.smartcase = true
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.signcolumn = 'yes'
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.updatetime = 250
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.timeoutlen = 300
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.splitright = true
|
|
|
+vim.opt.splitbelow = true
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.list = true
|
|
|
+vim.opt.listchars = { tab = '» ', trail = '·', nbsp = '␣' }
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.inccommand = 'split'
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.cursorline = true
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.scrolloff = 10
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+vim.opt.hlsearch = true
|
|
|
+vim.keymap.set('n', '<Esc>', '<cmd>nohlsearch<CR>')
|
|
|
+
|
|
|
+
|
|
|
+vim.keymap.set('n', '[d', vim.diagnostic.goto_prev, { desc = 'Go to previous [D]iagnostic message' })
|
|
|
+vim.keymap.set('n', ']d', vim.diagnostic.goto_next, { desc = 'Go to next [D]iagnostic message' })
|
|
|
+vim.keymap.set('n', '<leader>e', vim.diagnostic.open_float, { desc = 'Show diagnostic [E]rror messages' })
|
|
|
+vim.keymap.set('n', '<leader>q', vim.diagnostic.setloclist, { desc = 'Open diagnostic [Q]uickfix list' })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+vim.keymap.set('t', '<Esc><Esc>', '<C-\\><C-n>', { desc = 'Exit terminal mode' })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+vim.keymap.set('n', '<C-h>', '<C-w><C-h>', { desc = 'Move focus to the left window' })
|
|
|
+vim.keymap.set('n', '<C-l>', '<C-w><C-l>', { desc = 'Move focus to the right window' })
|
|
|
+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' })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+vim.api.nvim_create_autocmd('TextYankPost', {
|
|
|
+ desc = 'Highlight when yanking (copying) text',
|
|
|
+ group = vim.api.nvim_create_augroup('kickstart-highlight-yank', { clear = true }),
|
|
|
+ callback = function()
|
|
|
+ vim.highlight.on_yank()
|
|
|
+ end,
|
|
|
+})
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+local lazypath = vim.fn.stdpath 'data' .. '/lazy/lazy.nvim'
|
|
|
+if not vim.loop.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
|
|
|
+vim.opt.rtp:prepend(lazypath)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+require('lazy').setup({
|
|
|
+
|
|
|
+ 'tpope/vim-sleuth',
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ { 'numToStr/Comment.nvim', opts = {} },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ 'lewis6991/gitsigns.nvim',
|
|
|
+ opts = {
|
|
|
+ signs = {
|
|
|
+ add = { text = '+' },
|
|
|
+ change = { text = '~' },
|
|
|
+ delete = { text = '_' },
|
|
|
+ topdelete = { text = '‾' },
|
|
|
+ changedelete = { text = '~' },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ 'folke/which-key.nvim',
|
|
|
+ event = 'VimEnter',
|
|
|
+ config = function()
|
|
|
+ require('which-key').setup()
|
|
|
+
|
|
|
+
|
|
|
+ require('which-key').register {
|
|
|
+ ['<leader>c'] = { name = '[C]ode', _ = 'which_key_ignore' },
|
|
|
+ ['<leader>d'] = { name = '[D]ocument', _ = 'which_key_ignore' },
|
|
|
+ ['<leader>r'] = { name = '[R]ename', _ = 'which_key_ignore' },
|
|
|
+ ['<leader>s'] = { name = '[S]earch', _ = 'which_key_ignore' },
|
|
|
+ ['<leader>w'] = { name = '[W]orkspace', _ = 'which_key_ignore' },
|
|
|
+ }
|
|
|
+ end,
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ {
|
|
|
+ 'nvim-telescope/telescope.nvim',
|
|
|
+ event = 'VimEnter',
|
|
|
+ branch = '0.1.x',
|
|
|
+ dependencies = {
|
|
|
+ 'nvim-lua/plenary.nvim',
|
|
|
+ {
|
|
|
+ 'nvim-telescope/telescope-fzf-native.nvim',
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ build = 'make',
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ cond = function()
|
|
|
+ return vim.fn.executable 'make' == 1
|
|
|
+ end,
|
|
|
+ },
|
|
|
+ { 'nvim-telescope/telescope-ui-select.nvim' },
|
|
|
+
|
|
|
+
|
|
|
+ { 'nvim-tree/nvim-web-devicons', enabled = vim.g.have_nerd_font },
|
|
|
+ },
|
|
|
+ config = function()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ require('telescope').setup {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ extensions = {
|
|
|
+ ['ui-select'] = {
|
|
|
+ require('telescope.themes').get_dropdown(),
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ pcall(require('telescope').load_extension, 'fzf')
|
|
|
+ pcall(require('telescope').load_extension, 'ui-select')
|
|
|
+
|
|
|
+
|
|
|
+ local builtin = require 'telescope.builtin'
|
|
|
+ vim.keymap.set('n', '<leader>sh', builtin.help_tags, { desc = '[S]earch [H]elp' })
|
|
|
+ vim.keymap.set('n', '<leader>sk', builtin.keymaps, { desc = '[S]earch [K]eymaps' })
|
|
|
+ vim.keymap.set('n', '<leader>sf', builtin.find_files, { desc = '[S]earch [F]iles' })
|
|
|
+ vim.keymap.set('n', '<leader>ss', builtin.builtin, { desc = '[S]earch [S]elect Telescope' })
|
|
|
+ vim.keymap.set('n', '<leader>sw', builtin.grep_string, { desc = '[S]earch current [W]ord' })
|
|
|
+ vim.keymap.set('n', '<leader>sg', builtin.live_grep, { desc = '[S]earch by [G]rep' })
|
|
|
+ vim.keymap.set('n', '<leader>sd', builtin.diagnostics, { desc = '[S]earch [D]iagnostics' })
|
|
|
+ vim.keymap.set('n', '<leader>sr', builtin.resume, { desc = '[S]earch [R]esume' })
|
|
|
+ vim.keymap.set('n', '<leader>s.', builtin.oldfiles, { desc = '[S]earch Recent Files ("." for repeat)' })
|
|
|
+ vim.keymap.set('n', '<leader><leader>', builtin.buffers, { desc = '[ ] Find existing buffers' })
|
|
|
+
|
|
|
+
|
|
|
+ vim.keymap.set('n', '<leader>/', function()
|
|
|
+
|
|
|
+ builtin.current_buffer_fuzzy_find(require('telescope.themes').get_dropdown {
|
|
|
+ winblend = 10,
|
|
|
+ previewer = false,
|
|
|
+ })
|
|
|
+ end, { desc = '[/] Fuzzily search in current buffer' })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ vim.keymap.set('n', '<leader>s/', function()
|
|
|
+ builtin.live_grep {
|
|
|
+ grep_open_files = true,
|
|
|
+ prompt_title = 'Live Grep in Open Files',
|
|
|
+ }
|
|
|
+ end, { desc = '[S]earch [/] in Open Files' })
|
|
|
+
|
|
|
+
|
|
|
+ vim.keymap.set('n', '<leader>sn', function()
|
|
|
+ builtin.find_files { cwd = vim.fn.stdpath 'config' }
|
|
|
+ end, { desc = '[S]earch [N]eovim files' })
|
|
|
+ end,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ 'neovim/nvim-lspconfig',
|
|
|
+ dependencies = {
|
|
|
+
|
|
|
+ 'williamboman/mason.nvim',
|
|
|
+ 'williamboman/mason-lspconfig.nvim',
|
|
|
+ 'WhoIsSethDaniel/mason-tool-installer.nvim',
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ { 'j-hui/fidget.nvim', opts = {} },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ { 'folke/neodev.nvim', opts = {} },
|
|
|
+ },
|
|
|
+ config = function()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ vim.api.nvim_create_autocmd('LspAttach', {
|
|
|
+ group = vim.api.nvim_create_augroup('kickstart-lsp-attach', { clear = true }),
|
|
|
+ callback = function(event)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ local map = function(keys, func, desc)
|
|
|
+ vim.keymap.set('n', keys, func, { buffer = event.buf, desc = 'LSP: ' .. desc })
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ map('gd', require('telescope.builtin').lsp_definitions, '[G]oto [D]efinition')
|
|
|
+
|
|
|
+
|
|
|
+ map('gr', require('telescope.builtin').lsp_references, '[G]oto [R]eferences')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ map('gI', require('telescope.builtin').lsp_implementations, '[G]oto [I]mplementation')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ map('<leader>D', require('telescope.builtin').lsp_type_definitions, 'Type [D]efinition')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ map('<leader>ds', require('telescope.builtin').lsp_document_symbols, '[D]ocument [S]ymbols')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ map('<leader>ws', require('telescope.builtin').lsp_dynamic_workspace_symbols, '[W]orkspace [S]ymbols')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ map('<leader>rn', vim.lsp.buf.rename, '[R]e[n]ame')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ map('<leader>ca', vim.lsp.buf.code_action, '[C]ode [A]ction')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ map('K', vim.lsp.buf.hover, 'Hover Documentation')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ map('gD', vim.lsp.buf.declaration, '[G]oto [D]eclaration')
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ local client = vim.lsp.get_client_by_id(event.data.client_id)
|
|
|
+ if client and client.server_capabilities.documentHighlightProvider then
|
|
|
+ vim.api.nvim_create_autocmd({ 'CursorHold', 'CursorHoldI' }, {
|
|
|
+ buffer = event.buf,
|
|
|
+ callback = vim.lsp.buf.document_highlight,
|
|
|
+ })
|
|
|
+
|
|
|
+ vim.api.nvim_create_autocmd({ 'CursorMoved', 'CursorMovedI' }, {
|
|
|
+ buffer = event.buf,
|
|
|
+ callback = vim.lsp.buf.clear_references,
|
|
|
+ })
|
|
|
+ end
|
|
|
+ end,
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ local capabilities = vim.lsp.protocol.make_client_capabilities()
|
|
|
+ capabilities = vim.tbl_deep_extend('force', capabilities, require('cmp_nvim_lsp').default_capabilities())
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ local servers = {
|
|
|
+ clangd = {},
|
|
|
+
|
|
|
+ pyright = {},
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ lua_ls = {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ settings = {
|
|
|
+ Lua = {
|
|
|
+ completion = {
|
|
|
+ callSnippet = 'Replace',
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ require('mason').setup()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ local ensure_installed = vim.tbl_keys(servers or {})
|
|
|
+ vim.list_extend(ensure_installed, {
|
|
|
+ 'stylua',
|
|
|
+ })
|
|
|
+ require('mason-tool-installer').setup { ensure_installed = ensure_installed }
|
|
|
+
|
|
|
+ require('mason-lspconfig').setup {
|
|
|
+ handlers = {
|
|
|
+ function(server_name)
|
|
|
+ local server = servers[server_name] or {}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ server.capabilities = vim.tbl_deep_extend('force', {}, capabilities, server.capabilities or {})
|
|
|
+ require('lspconfig')[server_name].setup(server)
|
|
|
+ end,
|
|
|
+ },
|
|
|
+ }
|
|
|
+ end,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ 'stevearc/conform.nvim',
|
|
|
+ opts = {
|
|
|
+ notify_on_error = false,
|
|
|
+ format_on_save = function(bufnr)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ local disable_filetypes = { c = true, cpp = true }
|
|
|
+ return {
|
|
|
+ timeout_ms = 500,
|
|
|
+ lsp_fallback = not disable_filetypes[vim.bo[bufnr].filetype],
|
|
|
+ }
|
|
|
+ end,
|
|
|
+ formatters_by_ft = {
|
|
|
+ lua = { 'stylua' },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ },
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+ 'hrsh7th/nvim-cmp',
|
|
|
+ event = 'InsertEnter',
|
|
|
+ dependencies = {
|
|
|
+
|
|
|
+ {
|
|
|
+ 'L3MON4D3/LuaSnip',
|
|
|
+ build = (function()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if vim.fn.has 'win32' == 1 or vim.fn.executable 'make' == 0 then
|
|
|
+ return
|
|
|
+ end
|
|
|
+ return 'make install_jsregexp'
|
|
|
+ end)(),
|
|
|
+ dependencies = {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ },
|
|
|
+ 'saadparwaiz1/cmp_luasnip',
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 'hrsh7th/cmp-nvim-lsp',
|
|
|
+ 'hrsh7th/cmp-path',
|
|
|
+ },
|
|
|
+ config = function()
|
|
|
+
|
|
|
+ local cmp = require 'cmp'
|
|
|
+ local luasnip = require 'luasnip'
|
|
|
+ luasnip.config.setup {}
|
|
|
+
|
|
|
+ cmp.setup {
|
|
|
+ snippet = {
|
|
|
+ expand = function(args)
|
|
|
+ luasnip.lsp_expand(args.body)
|
|
|
+ end,
|
|
|
+ },
|
|
|
+ completion = { completeopt = 'menu,menuone,noinsert' },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ mapping = cmp.mapping.preset.insert {
|
|
|
+
|
|
|
+ ['<C-n>'] = cmp.mapping.select_next_item(),
|
|
|
+
|
|
|
+ ['<C-p>'] = cmp.mapping.select_prev_item(),
|
|
|
+
|
|
|
+
|
|
|
+ ['<C-b>'] = cmp.mapping.scroll_docs(-4),
|
|
|
+ ['<C-f>'] = cmp.mapping.scroll_docs(4),
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ['<C-y>'] = cmp.mapping.confirm { select = true },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ['<C-Space>'] = cmp.mapping.complete {},
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ ['<C-l>'] = cmp.mapping(function()
|
|
|
+ if luasnip.expand_or_locally_jumpable() then
|
|
|
+ luasnip.expand_or_jump()
|
|
|
+ end
|
|
|
+ end, { 'i', 's' }),
|
|
|
+ ['<C-h>'] = cmp.mapping(function()
|
|
|
+ if luasnip.locally_jumpable(-1) then
|
|
|
+ luasnip.jump(-1)
|
|
|
+ end
|
|
|
+ end, { 'i', 's' }),
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ },
|
|
|
+ sources = {
|
|
|
+ { name = 'nvim_lsp' },
|
|
|
+ { name = 'luasnip' },
|
|
|
+ { name = 'path' },
|
|
|
+ },
|
|
|
+ }
|
|
|
+ end,
|
|
|
+ },
|
|
|
+
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ 'folke/tokyonight.nvim',
|
|
|
+ priority = 1000,
|
|
|
+ init = function()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ vim.cmd.colorscheme 'tokyonight-night'
|
|
|
+
|
|
|
+
|
|
|
+ vim.cmd.hi 'Comment gui=none'
|
|
|
+ end,
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ { 'folke/todo-comments.nvim', event = 'VimEnter', dependencies = { 'nvim-lua/plenary.nvim' }, opts = { signs = false } },
|
|
|
+
|
|
|
+ {
|
|
|
+ 'echasnovski/mini.nvim',
|
|
|
+ config = function()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ require('mini.ai').setup { n_lines = 500 }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ require('mini.surround').setup()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ local statusline = require 'mini.statusline'
|
|
|
+
|
|
|
+ statusline.setup { use_icons = vim.g.have_nerd_font }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ statusline.section_location = function()
|
|
|
+ return '%2l:%-2v'
|
|
|
+ end
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ end,
|
|
|
+ },
|
|
|
+ {
|
|
|
+ 'nvim-treesitter/nvim-treesitter',
|
|
|
+ build = ':TSUpdate',
|
|
|
+ opts = {
|
|
|
+ ensure_installed = { 'bash', 'c', 'html', 'lua', 'markdown', 'vim', 'vimdoc', 'python' },
|
|
|
+
|
|
|
+ auto_install = true,
|
|
|
+ highlight = {
|
|
|
+ enable = true,
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ additional_vim_regex_highlighting = { 'ruby' },
|
|
|
+ },
|
|
|
+ indent = { enable = true, disable = { 'ruby' } },
|
|
|
+ },
|
|
|
+ config = function(_, opts)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ require('nvim-treesitter.configs').setup(opts)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ end,
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+}, {
|
|
|
+ ui = {
|
|
|
+
|
|
|
+
|
|
|
+ icons = vim.g.have_nerd_font and {} or {
|
|
|
+ cmd = '⌘',
|
|
|
+ config = '🛠',
|
|
|
+ event = '📅',
|
|
|
+ ft = '📂',
|
|
|
+ init = '⚙',
|
|
|
+ keys = '🗝',
|
|
|
+ plugin = '🔌',
|
|
|
+ runtime = '💻',
|
|
|
+ require = '🌙',
|
|
|
+ source = '📄',
|
|
|
+ start = '🚀',
|
|
|
+ task = '📌',
|
|
|
+ lazy = '💤 ',
|
|
|
+ },
|
|
|
+ },
|
|
|
+})
|
|
|
+
|
|
|
+require 'custom/options'
|
|
|
+require 'custom/keymap'
|
|
|
+
|
|
|
+
|
|
|
+
|