Compare commits

..

No commits in common. "d7402f4d53a3d7b18669d583c79bc39ec21e3092" and "6f55a6633341cd2ebfa93e79538d48b38b6839c0" have entirely different histories.

12 changed files with 136 additions and 137 deletions

View file

@ -39,26 +39,26 @@ opt.mouse = "a"
vim.filetype.add({ vim.filetype.add({
extension = { extension = {
vp = "glsl", vp = 'glsl',
fp = "glsl", fp = 'glsl',
gp = "glsl", gp = 'glsl',
vs = "glsl", vs = 'glsl',
fs = "glsl", fs = 'glsl',
gs = "glsl", gs = 'glsl',
tcs = "glsl", tcs = 'glsl',
tes = "glsl", tes = 'glsl',
cs = "glsl", cs = 'glsl',
vert = "glsl", vert = 'glsl',
frag = "glsl", frag = 'glsl',
geom = "glsl", geom = 'glsl',
tess = "glsl", tess = 'glsl',
shd = "glsl", shd = 'glsl',
gls = "glsl", gls = 'glsl',
glsl = "glsl", glsl = 'glsl',
rgen = "glsl", rgen = 'glsl',
comp = "glsl", comp = 'glsl',
rchit = "glsl", rchit = 'glsl',
rahit = "glsl", rahit = 'glsl',
rmiss = "glsl", rmiss = 'glsl',
} }
}) })

View file

@ -22,4 +22,4 @@ opt.scrolloff = 8
-- Show unprintable. -- Show unprintable.
opt.list = true opt.list = true
opt.listchars = {tab = "", eol = "¬", trail = "·"} opt.listchars = {tab = '', eol = '¬', trail = '·'}

View file

@ -1,17 +1,17 @@
-- Bootstrap lazy.nvim -- Bootstrap lazy.nvim
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim" local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
if not (vim.uv or vim.loop).fs_stat(lazypath) then if not (vim.uv or vim.loop).fs_stat(lazypath) then
local lazyrepo = "https://github.com/folke/lazy.nvim.git" local lazyrepo = "https://github.com/folke/lazy.nvim.git"
local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath }) local out = vim.fn.system({ "git", "clone", "--filter=blob:none", "--branch=stable", lazyrepo, lazypath })
if vim.v.shell_error ~= 0 then if vim.v.shell_error ~= 0 then
vim.api.nvim_echo({ vim.api.nvim_echo({
{ "Failed to clone lazy.nvim:\n", "ErrorMsg" }, { "Failed to clone lazy.nvim:\n", "ErrorMsg" },
{ out, "WarningMsg" }, { out, "WarningMsg" },
{ "\nPress any key to exit..." }, { "\nPress any key to exit..." },
}, true, {}) }, true, {})
vim.fn.getchar() vim.fn.getchar()
os.exit(1) os.exit(1)
end end
end end
vim.opt.rtp:prepend(lazypath) vim.opt.rtp:prepend(lazypath)
@ -23,10 +23,10 @@ vim.g.maplocalleader = "\\"
-- Setup lazy.nvim -- Setup lazy.nvim
require("lazy").setup({ require("lazy").setup({
spec = { spec = {
-- import your plugins -- import your plugins
{ import = "plugins" }, { import = "plugins" },
}, },
-- automatically check for plugin updates -- automatically check for plugin updates
checker = { enabled = false }, checker = { enabled = false },
}) })

View file

@ -1,4 +1,2 @@
All plugins what looks like a pure library (as a plenary.nvim) should be use in "depenedencies" filed and with "lazy = true". All plugins what looks like a pure library (as a plenary.nvim) should be use in "depenedencies" filed and with "lazy = true".
Main theme should be load during startup (lazy = false) and high priority. Main theme should be load during startup (lazy = false) and high priority.
If plugin required a "require("nvim-treesitter.configs").setup(opts)" we can use "main = 'nvim-treesitter.configs'" intead
will use it implicity in "config" and "opts" blocks.

View file

@ -1,9 +1,9 @@
return { return {
"stevearc/aerial.nvim", 'stevearc/aerial.nvim',
opts = {}, opts = {},
-- Optional dependencies -- Optional dependencies
dependencies = { dependencies = {
"nvim-treesitter/nvim-treesitter", "nvim-treesitter/nvim-treesitter",
"nvim-tree/nvim-web-devicons" "nvim-tree/nvim-web-devicons"
}, },
} }

View file

@ -1,9 +1,11 @@
return { return {
"ellisonleao/gruvbox.nvim", {
lazy = false, 'ellisonleao/gruvbox.nvim',
priority = 1000, lazy = false,
config = function() priority = 1000,
vim.cmd([[colorscheme gruvbox]]) config = function()
end, vim.cmd([[colorscheme gruvbox]])
opts = { style = "dark" } end,
} opts = { style = 'dark' }
},
} -- Main theme should be load during startup.

View file

@ -1,14 +1,13 @@
return { return { 'ej-shafran/compile-mode.nvim',
"ej-shafran/compile-mode.nvim", version = '^5.13.0',
version = "^5.13.0",
dependencies = { dependencies = {
"nvim-lua/plenary.nvim", lazy = true, 'nvim-lua/plenary.nvim', lazy = true,
"m00qek/baleia.nvim" 'm00qek/baleia.nvim',
}, },
config = function() config = function()
---@type CompileModeOpts ---@type CompileModeOpts
vim.g.compile_mode = { vim.g.compile_mode = {
default_command = "cmake --build build", default_command = 'cmake --build build',
input_word_completion = true, input_word_completion = true,
baleia_setup = true, baleia_setup = true,
bang_expansion = true, bang_expansion = true,

View file

@ -1,25 +1,24 @@
return { return {
"hrsh7th/nvim-cmp", 'hrsh7th/nvim-cmp',
dependencies = { dependencies = {
"neovim/nvim-lspconfig", 'neovim/nvim-lspconfig',
"hrsh7th/cmp-nvim-lsp", 'hrsh7th/cmp-nvim-lsp',
"petertriho/cmp-git", 'hrsh7th/cmp-buffer',
"hrsh7th/cmp-buffer", 'hrsh7th/cmp-path',
"hrsh7th/cmp-path", 'hrsh7th/cmp-cmdline',
"hrsh7th/cmp-cmdline", 'hrsh7th/cmp-vsnip',
"hrsh7th/cmp-vsnip", 'hrsh7th/vim-vsnip',
"hrsh7th/vim-vsnip", 'hrsh7th/cmp-nvim-lsp-signature-help',
"hrsh7th/cmp-nvim-lsp-signature-help",
}, },
config = function() config = function()
local cmp = require"cmp" local cmp = require'cmp'
cmp.setup({ cmp.setup({
snippet = { snippet = {
-- REQUIRED - you must specify a snippet engine -- REQUIRED - you must specify a snippet engine
expand = function(args) expand = function(args)
vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users. vim.fn["vsnip#anonymous"](args.body) -- For `vsnip` users.
-- require("luasnip").lsp_expand(args.body) -- For `luasnip` users. -- require('luasnip').lsp_expand(args.body) -- For `luasnip` users.
-- require("snippy").expand_snippet(args.body) -- For `snippy` users. -- require('snippy').expand_snippet(args.body) -- For `snippy` users.
-- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users. -- vim.fn["UltiSnips#Anon"](args.body) -- For `ultisnips` users.
end, end,
}, },
@ -28,56 +27,56 @@ return {
-- documentation = cmp.config.window.bordered(), -- documentation = cmp.config.window.bordered(),
}, },
mapping = cmp.mapping.preset.insert({ mapping = cmp.mapping.preset.insert({
["<C-b>"] = cmp.mapping.scroll_docs(-4), ['<C-b>'] = cmp.mapping.scroll_docs(-4),
["<C-f>"] = cmp.mapping.scroll_docs(4), ['<C-f>'] = cmp.mapping.scroll_docs(4),
["<C-Space>"] = cmp.mapping.complete(), ['<C-Space>'] = cmp.mapping.complete(),
["<C-e>"] = cmp.mapping.abort(), ['<C-e>'] = cmp.mapping.abort(),
["<CR>"] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items. ['<CR>'] = cmp.mapping.confirm({ select = true }), -- Accept currently selected item. Set `select` to `false` to only confirm explicitly selected items.
}), }),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "nvim_lsp" }, { name = 'nvim_lsp' },
{ name = "vsnip" }, -- For vsnip users. { name = 'vsnip' }, -- For vsnip users.
-- { name = "luasnip" }, -- For luasnip users. -- { name = 'luasnip' }, -- For luasnip users.
-- { name = "ultisnips" }, -- For ultisnips users. -- { name = 'ultisnips' }, -- For ultisnips users.
-- { name = "snippy" }, -- For snippy users. -- { name = 'snippy' }, -- For snippy users.
}, { }, {
{ name = "buffer" }, { name = 'buffer' },
{ name = "nvim_lsp_signature_help" }, { name = 'nvim_lsp_signature_help' },
}) })
}) })
-- Set configuration for specific filetype. -- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", { cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "git" }, { name = 'git' }, -- You can specify the `git` source if [you were installed it](https://github.com/petertriho/cmp-git).
}, { }, {
{ name = "buffer" }, { name = 'buffer' },
}) })
}) })
cmp.setup.filetype("cmake", { cmp.setup.filetype('cmake', {
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "cmake", "CMakeLists.txt" }, { name = 'cmake', "CMakeLists.txt" },
}, { }, {
{ name = "buffer" }, { name = 'buffer' },
}) })
}) })
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won"t work anymore). -- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ "/", "?" }, { cmp.setup.cmdline({ '/', '?' }, {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = { sources = {
{ name = "buffer" } { name = 'buffer' }
} }
}) })
-- Use cmdline & path source for ":" (if you enabled `native_menu`, this won"t work anymore). -- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline(":", { cmp.setup.cmdline(':', {
mapping = cmp.mapping.preset.cmdline(), mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({ sources = cmp.config.sources({
{ name = "path" } { name = 'path' }
}, { }, {
{ name = "cmdline" } { name = 'cmdline' }
}) })
}) })
end, end,

View file

@ -1,9 +1,9 @@
return { return {
"neovim/nvim-lspconfig", 'neovim/nvim-lspconfig',
config = function() config = function()
-- Setup language servers -- Setup language servers
-- Server-specific settings. See `:help lspconfig-all` -- Server-specific settings. See `:help lspconfig-all`
vim.lsp.config("*", { vim.lsp.config('*', {
capabilities = { capabilities = {
textDocument = { textDocument = {
semanticTokens = { semanticTokens = {
@ -11,47 +11,47 @@ return {
} }
} }
}, },
root_markers = { ".git" }, root_markers = { '.git' },
}) })
vim.lsp.config("clangd", { vim.lsp.config('clangd', {
cmd = { "clangd", "--background-index", "--clang-tidy", "--log=verbose", "--header-insertion=never" }, cmd = { 'clangd', '--background-index', '--clang-tidy', '--log=verbose', '--header-insertion=never' },
filetypes = { "c", "cpp" } filetypes = { 'c', 'cpp' }
}) })
vim.lsp.enable("clangd") vim.lsp.enable('clangd')
-- Global mappings. -- Global mappings.
-- See `:help vim.diagnostic.*` for documentation on any of the below functions -- See `:help vim.diagnostic.*` for documentation on any of the below functions
vim.keymap.set("n", "<space>e", vim.diagnostic.open_float) vim.keymap.set('n', '<space>e', vim.diagnostic.open_float)
vim.keymap.set("n", "[d", vim.diagnostic.goto_prev) vim.keymap.set('n', '[d', vim.diagnostic.goto_prev)
vim.keymap.set("n", "]d", vim.diagnostic.goto_next) vim.keymap.set('n', ']d', vim.diagnostic.goto_next)
vim.keymap.set("n", "<space>q", vim.diagnostic.setloclist) vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist)
-- Use LspAttach autocommand to only map the following keys -- Use LspAttach autocommand to only map the following keys
-- after the language server attaches to the current buffer -- after the language server attaches to the current buffer
vim.api.nvim_create_autocmd("LspAttach", { vim.api.nvim_create_autocmd('LspAttach', {
group = vim.api.nvim_create_augroup("UserLspConfig", {}), group = vim.api.nvim_create_augroup('UserLspConfig', {}),
callback = function(ev) callback = function(ev)
-- Enable completion triggered by <c-x><c-o> -- Enable completion triggered by <c-x><c-o>
vim.bo[ev.buf].omnifunc = "v:lua.vim.lsp.omnifunc" vim.bo[ev.buf].omnifunc = 'v:lua.vim.lsp.omnifunc'
-- Buffer local mappings. -- Buffer local mappings.
-- See `:help vim.lsp.*` for documentation on any of the below functions -- See `:help vim.lsp.*` for documentation on any of the below functions
local opts = { buffer = ev.buf } local opts = { buffer = ev.buf }
vim.keymap.set("n", "gD", vim.lsp.buf.declaration, opts) vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, opts)
vim.keymap.set("n", "gd", vim.lsp.buf.definition, opts) vim.keymap.set('n', 'gd', vim.lsp.buf.definition, opts)
vim.keymap.set("n", "K", vim.lsp.buf.hover, opts) vim.keymap.set('n', 'K', vim.lsp.buf.hover, opts)
vim.keymap.set("n", "gi", vim.lsp.buf.implementation, opts) vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, opts)
vim.keymap.set("n", "<C-k>", vim.lsp.buf.signature_help, opts) vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, opts)
vim.keymap.set("n", "<space>wa", vim.lsp.buf.add_workspace_folder, opts) vim.keymap.set('n', '<space>wa', vim.lsp.buf.add_workspace_folder, opts)
vim.keymap.set("n", "<space>wr", vim.lsp.buf.remove_workspace_folder, opts) vim.keymap.set('n', '<space>wr', vim.lsp.buf.remove_workspace_folder, opts)
vim.keymap.set("n", "<space>wl", function() vim.keymap.set('n', '<space>wl', function()
print(vim.inspect(vim.lsp.buf.list_workspace_folders())) print(vim.inspect(vim.lsp.buf.list_workspace_folders()))
end, opts) end, opts)
vim.keymap.set("n", "<space>D", vim.lsp.buf.type_definition, opts) vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, opts)
vim.keymap.set("n", "<space>rn", vim.lsp.buf.rename, opts) vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, opts)
vim.keymap.set({ "n", "v" }, "<space>ca", vim.lsp.buf.code_action, opts) vim.keymap.set({ 'n', 'v' }, '<space>ca', vim.lsp.buf.code_action, opts)
vim.keymap.set("n", "gr", vim.lsp.buf.references, opts) vim.keymap.set('n', 'gr', vim.lsp.buf.references, opts)
vim.keymap.set("n", "<space>f", function() vim.keymap.set('n', '<space>f', function()
vim.lsp.buf.format { async = true } vim.lsp.buf.format { async = true }
end, opts) end, opts)
end, end,

View file

@ -1,9 +1,9 @@
return { return { "nvim-treesitter/nvim-treesitter",
"nvim-treesitter/nvim-treesitter",
build = ":TSUpdate", build = ":TSUpdate",
main = "nvim-treesitter.configs", config = function()
opts = { require("nvim-treesitter.configs").setup {
ensure_installed = { "c", "cpp", "lua" }, ensure_installed = { 'c', 'cpp', 'lua' },
highlight = { enable = true, } highlight = { enable = true, }
} }
end
} }

View file

@ -1,6 +1,6 @@
return { return {
'nvim-telescope/telescope.nvim', tag = '0.1.8', 'nvim-telescope/telescope.nvim', tag = '0.1.8',
dependencies = { 'nvim-lua/plenary.nvim', lazy = true, 'nvim-tree/nvim-web-devicons', dependencies = { 'nvim-lua/plenary.nvim', lazy = true,
{ {
'nvim-telescope/telescope-fzf-native.nvim', 'nvim-telescope/telescope-fzf-native.nvim',
build = (build_cmd ~= 'cmake') and 'make' build = (build_cmd ~= 'cmake') and 'make'
@ -25,6 +25,7 @@ return {
} }
telescope.load_extension('fzf') telescope.load_extension('fzf')
-- TODO: use keys = { }
local builtin = require('telescope.builtin') local builtin = require('telescope.builtin')
vim.keymap.set('n', '<C-p>', builtin.find_files, {}) vim.keymap.set('n', '<C-p>', builtin.find_files, {})
vim.keymap.set('n', '<leader>ft', builtin.treesitter, {}) vim.keymap.set('n', '<leader>ft', builtin.treesitter, {})

View file

@ -1 +1 @@
return { "tpope/vim-commentary" } return { 'tpope/vim-commentary' }