Compare commits

...

2 Commits

Author SHA1 Message Date
Yannick Reiß 9c504e284f Make view nicer
Test Neovim config on push / build (ubuntu-20.04) (push) Failing after 22s Details
2024-07-26 07:42:31 +02:00
Yannick Reiß e1711a1180 C and Makefile snippets 2024-07-26 07:42:13 +02:00
7 changed files with 37 additions and 39 deletions

View File

@ -105,7 +105,7 @@ snippet "(\w+) = malloc" "Automativ malloc error implementation" rA
`!p snip.rv = match.group(1)` = ($1*)malloc(sizeof(${1:int}) * $2);
if (!`!p snip.rv = match.group(1)`) {
/* Error */
(void)printf("malloc error on memory allocation of: `!p snip.rv = match.group(1)`!\n");
(void)printf("ERROR: malloc error on memory allocation of: `!p snip.rv = match.group(1)`!\n");
exit(EXIT_FAILURE);
}
$0

View File

@ -108,3 +108,9 @@ snippet rule "Add new Rule"
${1:all}: $2
$0
endsnippet
snippet clean "Clean the object files and binary file" b
.PHONY: clean
clean:
${1:rm *.o $(BIN)}
endsnippet

View File

@ -54,11 +54,12 @@ cmp.setup({
{ name = "path" },
{ name = "nvim_lsp", keyword_length = 2 },
{ name = "nvim_lsp_signature_help" },
-- { name = "nvim_lua", keyword_length = 2 },
{ name = "nvim_lua", keyword_length = 2 },
{ name = "buffer", keyword_length = 2 },
{ name = "calc" },
{ name = "lua-latex-symbols", option = { cache = true } },
{ name = "cmp_tabnine", keyword_length = 3 },
{ name = "cmp_tabnine", keyword_length = 20 },
{ name = "fuzzy_buffer", keyword_length = 4 },
}),
-- add formatting of the different sources
@ -67,13 +68,12 @@ cmp.setup({
format = function(entry, item)
local menu_icon = {
nvim_lsp = "λ",
-- ultisnips = "⋗",
path = "🌐",
path = "󰴠",
calc = "Σ",
buffer = "📚",
lualatexsymbols = "𝕋",
spell = "📚",
fuzzy_buffer = "📄",
buffer = "",
lualatexsymbols = "󰿈",
spell = "󰘝",
fuzzy_buffer = "",
cmp_tabnine = "🖳",
}
item.menu = menu_icon[entry.source.name]
@ -82,26 +82,19 @@ cmp.setup({
},
})
-- Set configuration for specific filetype.
cmp.setup.filetype("gitcommit", {
sources = cmp.config.sources({
{ name = "cmp_git" }, -- You can specify the `cmp_git` source if you were installed it.
}, {
{ name = "buffer" },
}),
})
-- Use buffer source for `/` and `?` (if you enabled `native_menu`, this won't work anymore).
cmp.setup.cmdline({ "/", "?" }, {
mapping = cmp.mapping.preset.cmdline(),
sources = {
{ name = "buffer" },
{ name = "fuzzy_path", keyword_length = 4 },
},
formatting = {
fields = { "menu", "abbr", "kind" },
format = function(entry, item)
local menu_icon = {
buffer = "📚",
buffer = "󰱼",
fuzzy_path = "",
}
item.menu = menu_icon[entry.source.name]
return item
@ -114,17 +107,17 @@ cmp.setup.cmdline(":", {
mapping = cmp.mapping.preset.cmdline(),
sources = cmp.config.sources({
{ name = "path" },
{ name = "cmdline_history", keyword_length = 8 },
{ name = "cmdline_history", keyword_length = 24 },
}, {
{ name = "cmdline" },
{ name = "cmdline", keyword_length = 1 },
}),
formatting = {
fields = { "menu", "abbr", "kind" },
format = function(entry, item)
local menu_icon = {
path = "🌐",
cmdline = "💻",
cmdline_history = "📰",
path = "󰙅",
cmdline = "",
cmdline_history = "󰂺 ",
}
item.menu = menu_icon[entry.source.name]
return item

View File

@ -38,8 +38,8 @@ require("telescope").load_extension("ultisnips")
vim.keymap.set("n", "<leader>fs", require("telescope").extensions.ultisnips.ultisnips, {})
-- NERDTree Config
vim.g.NERDTreeDirArrowExpandable = ""
vim.g.NERDTreeDirArrowCollapsible = ""
vim.g.NERDTreeDirArrowExpandable = ""
vim.g.NERDTreeDirArrowCollapsible = ""
-- Git-Blame configuration
vim.g.gitblame_message_template = " => <author> • <date> • <summary>"
@ -53,7 +53,7 @@ require("mason").setup(require("mason").setup({
ui = {
icons = {
package_installed = "",
package_pending = "",
package_pending = "󰔟",
package_uninstalled = "",
},
},
@ -87,7 +87,7 @@ require("lspconfig").verible.setup({
vim.keymap.set("n", "<C-t>", ":FloatermNew --height=0.9 --width=0.9 --wintype=float --name=terminal <CR>")
-- Set default colorscheme
vim.cmd("colo vim-monokai-tasty")
vim.cmd("colo tokyonight-night")
-- Formatter configuration
vim.cmd([[
@ -108,6 +108,7 @@ local linters = {
markdown = { "languagetool" },
latex = { "languagetool" },
tex = { "languagetool" },
plaintex = { "languagetool" },
ada = { "gnat" },
}

View File

@ -23,6 +23,7 @@ return {
"p00f/nvim-ts-rainbow",
"cohama/lexima.vim",
"ryanoasis/vim-devicons",
"tiagofumo/vim-nerdtree-syntax-highlight",
{
"nvim-telescope/telescope.nvim",
tag = "0.1.5",
@ -49,7 +50,7 @@ return {
"dmitmel/cmp-cmdline-history",
"amarakon/nvim-cmp-lua-latex-symbols",
"f3fora/cmp-spell",
{ "petertriho/cmp-git", requires = "nvim-lua/plenary.nvim" },
{ "tzachar/cmp-fuzzy-buffer", requires = { "hrsh7th/nvim-cmp", "tzachar/fuzzy.nvim" } },
"williamboman/mason.nvim",
"williamboman/mason-lspconfig.nvim",
"neovim/nvim-lspconfig",
@ -59,7 +60,6 @@ return {
{ "nvim-telescope/telescope-fzf-native.nvim", run = "make" },
{ "tzachar/fuzzy.nvim", requires = { "nvim-telescope/telescope-fzf-native.nvim" } },
{ "tzachar/cmp-fuzzy-buffer", requires = { "hrsh7th/nvim-cmp", "tzachar/fuzzy.nvim" } },
-- "quangnguyen30192/cmp-nvim-ultisnips",
"mihaifm/bufstop",
"https://git.nickr.eu/yannickreiss/nvim-sourcer.git",
{ "tzachar/cmp-fuzzy-buffer", requires = { "hrsh7th/nvim-cmp", "tzachar/fuzzy.nvim" } },

View File

@ -1,14 +1,12 @@
-- in tools.lua
local api = vim.api
local M = {};
local M = {}
function M.makeScratch()
vim.bo[0].buftype = nofile -- set the current buffer's (buffer 0) buftype to nofile
vim.bo[0].bufhidden = hide
vim.bo[0].swapfile = false
end;
end
return M;
return M

View File

@ -33,7 +33,7 @@ vim.o.guifont = "Source Code Pro:h13"
vim.opt.termguicolors = true
vim.cmd("colorscheme slate")
vim.keymap.set("n", "<M-+>", ":colo tokyonight-day<CR>")
vim.keymap.set("n", "<M-->", ":colo tokyonight-moon<CR>")
vim.keymap.set("n", "<M-->", ":colo tokyonight-night<CR>")
vim.opt.mouse = ""