Update NeoVIM configuration with build system
This commit is contained in:
parent
2a29b0e559
commit
ac171b055b
@ -10,14 +10,18 @@ require('packer').startup(function()
|
||||
-- Package manager (Self update)
|
||||
use 'wbthomason/packer.nvim'
|
||||
-- General Editing
|
||||
use 'b3nj5m1n/kommentary' -- 'gc' to comment visual regions/lines
|
||||
use {
|
||||
'numToStr/Comment.nvim', -- 'gc' to comment visual regions/lines
|
||||
config = function()
|
||||
require('Comment').setup()
|
||||
end
|
||||
}
|
||||
use {
|
||||
'Konfekt/vim-sentence-chopper', -- 'gw' to split using sentences
|
||||
config = function() vim.g.latexindent = false end, -- "gw" should not use latexindent
|
||||
}
|
||||
use 'beauwilliams/focus.nvim' -- Automatically resize based on focused window
|
||||
-- Appearance
|
||||
use {
|
||||
use {
|
||||
'cormacrelf/dark-notify', -- Automatic theme switching
|
||||
requires = {
|
||||
'hoob3rt/lualine.nvim', -- Status line
|
||||
@ -33,7 +37,11 @@ require('packer').startup(function()
|
||||
'folke/which-key.nvim', -- Show key mappings
|
||||
config = function() require('plugins.keymap') end,
|
||||
}
|
||||
-- -- Language configuration
|
||||
use {
|
||||
"beauwilliams/focus.nvim",
|
||||
config = function() require("focus").setup() end,
|
||||
}
|
||||
-- Language configuration
|
||||
use {
|
||||
'neovim/nvim-lspconfig', -- Configuration of LSP
|
||||
requires = {
|
||||
@ -49,9 +57,14 @@ require('packer').startup(function()
|
||||
require('lang.python')
|
||||
require('lang.rust')
|
||||
require('lang.tex')
|
||||
require('lang.yaml')
|
||||
require('lang.zinc')
|
||||
end,
|
||||
}
|
||||
use {
|
||||
'pianocomposer321/yabs.nvim', -- Build System
|
||||
config = require('lang.build').conf_yabs,
|
||||
}
|
||||
-- Auto-completion
|
||||
use {
|
||||
'hrsh7th/nvim-cmp',
|
||||
|
58
dot_config/nvim/lua/lang/build.lua
Normal file
58
dot_config/nvim/lua/lang/build.lua
Normal file
@ -0,0 +1,58 @@
|
||||
-- YABS
|
||||
function conf_yabs()
|
||||
local c_tasks = {
|
||||
default_task = "build",
|
||||
tasks = {
|
||||
build = {
|
||||
command = "cmake --build build --config Debug",
|
||||
output = "quickfix",
|
||||
},
|
||||
build_rel = {
|
||||
command = "cmake --build build --config Release",
|
||||
output = "quickfix",
|
||||
},
|
||||
clean = {
|
||||
command = "cmake --build build --target clean",
|
||||
output = "quickfix",
|
||||
},
|
||||
}
|
||||
}
|
||||
require("yabs"):setup {
|
||||
languages = {
|
||||
cpp = c_tasks,
|
||||
c = c_tasks,
|
||||
rust = {
|
||||
default_task = "build",
|
||||
tasks = {
|
||||
build = {
|
||||
command = "cargo build -q",
|
||||
output = "quickfix",
|
||||
},
|
||||
build_rel = {
|
||||
command = "cargo build -q --release",
|
||||
output = "quickfix",
|
||||
},
|
||||
clean = {
|
||||
command = "cargo clean",
|
||||
output = "quickfix",
|
||||
},
|
||||
run = {
|
||||
command = "cargo run",
|
||||
output = "quickfix",
|
||||
},
|
||||
}
|
||||
},
|
||||
},
|
||||
-- Default tasks
|
||||
tasks = {},
|
||||
opts = {
|
||||
output_types = {
|
||||
quickfix = {
|
||||
open_on_run = "always"
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
end
|
||||
|
||||
return { conf_yabs = conf_yabs }
|
1
dot_config/nvim/lua/lang/yaml.lua
Normal file
1
dot_config/nvim/lua/lang/yaml.lua
Normal file
@ -0,0 +1 @@
|
||||
vim.cmd('autocmd Filetype yaml setlocal tabstop=2 shiftwidth=2 expandtab')
|
@ -2,22 +2,26 @@
|
||||
local conf_cmp = function()
|
||||
local cmp = require('cmp')
|
||||
cmp.setup({
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-y>'] = cmp.mapping.confirm({ select = true }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'buffer' },
|
||||
{ name = 'crates' },
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'path' },
|
||||
}
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["vsnip#anonymous"](args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-f>'] = cmp.mapping.scroll_docs(4),
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
['<C-e>'] = cmp.mapping.close(),
|
||||
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||
},
|
||||
sources = {
|
||||
{ name = 'buffer' },
|
||||
{ name = 'crates' },
|
||||
{ name = 'nvim_lua' },
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'path' },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
return { conf_cmp = conf_cmp }
|
||||
return { conf_cmp = conf_cmp }
|
||||
|
@ -43,6 +43,8 @@ local mappings = {
|
||||
-- Project
|
||||
p = {
|
||||
f = { "<cmd>lua require('telescope.builtin').find_files()<cr>", "Search Project" },
|
||||
b = { "<cmd>lua require('yabs'):run_default_task()<cr>", "Build Project" },
|
||||
t = { "<cmd>lua require('telescope').extensions.yabs.tasks()<cr>", "Search Project" },
|
||||
},
|
||||
|
||||
-- Window
|
||||
|
@ -1,17 +1,6 @@
|
||||
-- Telescope
|
||||
local conf_telescope = function()
|
||||
require('telescope').setup {
|
||||
defaults = {
|
||||
mappings = {
|
||||
i = {
|
||||
["<C-u>"] = false,
|
||||
["<C-d>"] = false,
|
||||
},
|
||||
},
|
||||
generic_sorter = require'telescope.sorters'.get_fzy_sorter,
|
||||
file_sorter = require'telescope.sorters'.get_fzy_sorter,
|
||||
}
|
||||
}
|
||||
function conf_telescope()
|
||||
require("telescope").setup {}
|
||||
end
|
||||
|
||||
return { conf_telescope = conf_telescope }
|
||||
return { conf_telescope = conf_telescope }
|
||||
|
Loading…
x
Reference in New Issue
Block a user