commit
537b54f18f
25
init.lua
25
init.lua
|
|
@ -99,7 +99,7 @@ do
|
|||
vim.g.maplocalleader = ' '
|
||||
|
||||
-- Set to true if you have a Nerd Font installed and selected in the terminal
|
||||
vim.g.have_nerd_font = false
|
||||
vim.g.have_nerd_font = true
|
||||
|
||||
-- [[ Setting options ]]
|
||||
-- See `:help vim.o`
|
||||
|
|
@ -778,6 +778,7 @@ do
|
|||
local enabled_filetypes = {
|
||||
-- lua = true,
|
||||
-- python = true,
|
||||
cpp = true;
|
||||
}
|
||||
if enabled_filetypes[vim.bo[bufnr].filetype] then
|
||||
return { timeout_ms = 500 }
|
||||
|
|
@ -796,6 +797,8 @@ do
|
|||
--
|
||||
-- You can use 'stop_after_first' to run the first available formatter from the list
|
||||
-- javascript = { "prettierd", "prettier", stop_after_first = true },
|
||||
cpp = {"clang-format"},
|
||||
c = {"clang-format"},
|
||||
},
|
||||
}
|
||||
|
||||
|
|
@ -898,9 +901,9 @@ do
|
|||
vim.pack.add { { src = gh 'nvim-treesitter/nvim-treesitter', version = 'main' } }
|
||||
|
||||
-- Ensure basic parsers are installed
|
||||
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' }
|
||||
local parsers = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc', 'cpp', 'python' }
|
||||
require('nvim-treesitter').install(parsers)
|
||||
|
||||
|
||||
---@param buf integer
|
||||
---@param language string
|
||||
local function treesitter_try_attach(buf, language)
|
||||
|
|
@ -919,7 +922,7 @@ do
|
|||
local has_indent_query = vim.treesitter.query.get(language, 'indents') ~= nil
|
||||
|
||||
-- Enable treesitter based indentation
|
||||
if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end
|
||||
--if has_indent_query then vim.bo.indentexpr = "v:lua.require'nvim-treesitter'.indentexpr()" end
|
||||
end
|
||||
|
||||
local available_parsers = require('nvim-treesitter').get_available()
|
||||
|
|
@ -960,17 +963,17 @@ do
|
|||
-- Here are some example plugins that I've included in the Kickstart repository.
|
||||
-- Uncomment any of the lines below to enable them (you will need to restart nvim).
|
||||
--
|
||||
-- require 'kickstart.plugins.debug'
|
||||
-- require 'kickstart.plugins.indent_line'
|
||||
-- require 'kickstart.plugins.lint'
|
||||
-- require 'kickstart.plugins.autopairs'
|
||||
-- require 'kickstart.plugins.neo-tree'
|
||||
-- require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps
|
||||
require 'kickstart.plugins.debug'
|
||||
require 'kickstart.plugins.indent_line'
|
||||
require 'kickstart.plugins.lint'
|
||||
require 'kickstart.plugins.autopairs'
|
||||
require 'kickstart.plugins.neo-tree'
|
||||
require 'kickstart.plugins.gitsigns' -- adds gitsigns recommended keymaps
|
||||
|
||||
-- NOTE: You can add your own plugins, configuration, etc from `lua/custom/plugins/*.lua`
|
||||
--
|
||||
-- Uncomment the following line and add your plugins to `lua/custom/plugins/*.lua` to get going.
|
||||
-- require 'custom.plugins'
|
||||
require 'custom.plugins'
|
||||
end
|
||||
|
||||
-- The line beneath this is called `modeline`. See `:help modeline`
|
||||
|
|
|
|||
|
|
@ -0,0 +1,30 @@
|
|||
vim.pack.add({
|
||||
"https://github.com/ellisonleao/gruvbox.nvim"
|
||||
})
|
||||
|
||||
-- Default options:
|
||||
require("gruvbox").setup({
|
||||
terminal_colors = true, -- add neovim terminal colors
|
||||
undercurl = true,
|
||||
underline = true,
|
||||
bold = true,
|
||||
italic = {
|
||||
strings = true,
|
||||
emphasis = true,
|
||||
comments = true,
|
||||
operators = false,
|
||||
folds = true,
|
||||
},
|
||||
strikethrough = true,
|
||||
invert_selection = false,
|
||||
invert_signs = false,
|
||||
invert_tabline = false,
|
||||
inverse = true, -- invert background for search, diffs, statuslines and errors
|
||||
contrast = "", -- can be "hard", "soft" or empty string
|
||||
palette_overrides = {},
|
||||
overrides = {},
|
||||
dim_inactive = false,
|
||||
transparent_mode = false,
|
||||
})
|
||||
vim.cmd("colorscheme gruvbox")
|
||||
|
||||
Loading…
Reference in New Issue