4.4 Init
This commit is contained in:
@@ -1,106 +0,0 @@
|
||||
-- menuone: show also for just one code suggestion
|
||||
-- noinsert: only insert text when selection confirmed
|
||||
-- noselect: force to select from suggestion
|
||||
-- preview: show more details
|
||||
vim.opt.completeopt = { "menu", "menuone" }
|
||||
|
||||
-- shortmess is used to reduce verbocity
|
||||
-- vim.opt.shortmess = vim.opt.shortmess + { c = true }
|
||||
local cmp = require("cmp")
|
||||
cmp.setup({
|
||||
-- configuration
|
||||
snippet = {
|
||||
expand = function(args)
|
||||
vim.fn["UltiSnips#Anon"](args.body)
|
||||
end,
|
||||
},
|
||||
|
||||
-- Add borders to the windows
|
||||
-- window = {
|
||||
-- completion = cmp.config.window.bordered(),
|
||||
-- documentation = cmp.config.window.bordered(),
|
||||
-- },
|
||||
|
||||
-- mapping
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- Shift+TAB to go to the Previous Suggested item
|
||||
["<C-k>"] = cmp.mapping.select_prev_item(),
|
||||
-- Tab to go to the next suggestion
|
||||
["<C-j>"] = cmp.mapping.select_next_item(),
|
||||
-- CTRL+SHIFT+f to scroll backwards in description
|
||||
["<C-S-f>"] = cmp.mapping.scroll_docs(-4),
|
||||
-- CTRL+F to scroll forwards in the description
|
||||
["<C-f>"] = cmp.mapping.scroll_docs(4),
|
||||
-- CTRL+SPACE to bring up completion at current Cursor location
|
||||
["<C-Space>"] = cmp.mapping.complete(),
|
||||
-- CTRL+e to exit suggestion and close it
|
||||
["<C-d>"] = cmp.mapping.close(), -- TODO: Search better option
|
||||
-- CR (enter or return) to CONFIRM the currently selection suggestion
|
||||
-- We set the ConfirmBehavior to insert the Selected suggestion
|
||||
["<CR>"] = cmp.mapping.confirm({
|
||||
behavior = cmp.ConfirmBehavior.Insert,
|
||||
select = true,
|
||||
}),
|
||||
}),
|
||||
|
||||
-- installed sources for code suggestion
|
||||
sources = cmp.config.sources({
|
||||
{ name = "ultisnips", keyword_length = 1 },
|
||||
{ name = "path" },
|
||||
{ name = "nvim_lsp", keyword_length = 2 },
|
||||
{ name = "nvim_lsp_signature_help" },
|
||||
{ name = "nvim_lua", keyword_length = 4 },
|
||||
{ name = "buffer", keyword_length = 3 },
|
||||
{ name = "calc" },
|
||||
{ name = "lua-latex-symbols", option = { cache = true } },
|
||||
-- { name = "spell", option = { keep_all_entries = false }, keyword_length = 2 },
|
||||
-- { name = "fuzzy_buffer", keyword_length = 2 }, -- Throwing unknown errors
|
||||
}),
|
||||
|
||||
-- add formatting of the different sources
|
||||
formatting = {
|
||||
fields = { "menu", "abbr", "kind" },
|
||||
format = function(entry, item)
|
||||
local menu_icon = {
|
||||
nvim_lsp = "λ",
|
||||
ultisnips = "⋗",
|
||||
path = "🌐",
|
||||
calc = "Σ",
|
||||
buffer = "📚",
|
||||
lualatexsymbols = "𝕋",
|
||||
spell = "📚",
|
||||
fuzzy_buffer = "📄",
|
||||
}
|
||||
item.menu = menu_icon[entry.source.name]
|
||||
return item
|
||||
end,
|
||||
},
|
||||
})
|
||||
|
||||
-- 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" },
|
||||
},
|
||||
})
|
||||
|
||||
-- Use cmdline & path source for ':' (if you enabled `native_menu`, this won't work anymore).
|
||||
cmp.setup.cmdline(":", {
|
||||
mapping = cmp.mapping.preset.cmdline(),
|
||||
sources = cmp.config.sources({
|
||||
{ name = "path" },
|
||||
{ name = "cmdline_history", keyword_length = 15 },
|
||||
}, {
|
||||
{ name = "cmdline" },
|
||||
}),
|
||||
})
|
||||
@@ -1,56 +0,0 @@
|
||||
-- Utilities for creating configurations
|
||||
local util = require("formatter.util")
|
||||
|
||||
-- Provides the Format, FormatWrite, FormatLock, and FormatWriteLock commands
|
||||
require("formatter").setup({
|
||||
-- Enable or disable logging
|
||||
logging = true,
|
||||
-- Set the log level
|
||||
log_level = vim.log.levels.WARN,
|
||||
-- All formatter configurations are opt-in
|
||||
filetype = {
|
||||
-- Formatter configurations for filetype "lua" go here
|
||||
-- and will be executed in order
|
||||
lua = {
|
||||
-- "formatter.filetypes.lua" defines default configurations for the
|
||||
-- "lua" filetype
|
||||
require("formatter.filetypes.lua").stylua,
|
||||
},
|
||||
|
||||
c = {
|
||||
require("formatter.filetypes.c").astyle,
|
||||
},
|
||||
|
||||
cpp = {
|
||||
require("formatter.filetypes.cpp").astyle,
|
||||
},
|
||||
|
||||
html = {
|
||||
require("formatter.filetypes.html").htmlbeautifier,
|
||||
},
|
||||
|
||||
latex = {
|
||||
require("formatter.filetypes.latex").latexindent,
|
||||
},
|
||||
|
||||
markdown = {
|
||||
require("formatter.filetypes.markdown").prettier,
|
||||
},
|
||||
|
||||
tex = {
|
||||
require("formatter.filetypes.latex").latexindent,
|
||||
},
|
||||
|
||||
rust = {
|
||||
require("formatter.filetypes.rust").rustfmt,
|
||||
},
|
||||
|
||||
-- Use the special "*" filetype for defining formatter configurations on
|
||||
-- any filetype
|
||||
["*"] = {
|
||||
-- "formatter.filetypes.any" defines default configurations for any
|
||||
-- filetype
|
||||
require("formatter.filetypes.any").remove_trailing_whitespace,
|
||||
},
|
||||
},
|
||||
})
|
||||
@@ -1,23 +0,0 @@
|
||||
-- default config:
|
||||
require("peek").setup({
|
||||
auto_load = true, -- whether to automatically load preview when
|
||||
-- entering another markdown buffer
|
||||
close_on_bdelete = true, -- close preview window on buffer delete
|
||||
|
||||
syntax = true, -- enable syntax highlighting, affects performance
|
||||
|
||||
theme = "dark", -- 'dark' or 'light'
|
||||
|
||||
update_on_change = true,
|
||||
|
||||
app = "webview", -- 'webview', 'browser', string or a table of strings
|
||||
-- explained below
|
||||
|
||||
filetype = { "markdown" }, -- list of filetypes to recognize as markdown
|
||||
|
||||
-- relevant if update_on_change is true
|
||||
throttle_at = 200000, -- start throttling when file exceeds this
|
||||
-- amount of bytes in size
|
||||
throttle_time = "auto", -- minimum amount of time in milliseconds
|
||||
-- that has to pass before starting new render
|
||||
})
|
||||
@@ -1,31 +0,0 @@
|
||||
local M = {}
|
||||
|
||||
-- Delete area in between the current and next occurrence of the current symbol under cursor.
|
||||
-- use builtin functionality for opening brackets
|
||||
function M.Delete_interval()
|
||||
-- TODO: Think of something
|
||||
end
|
||||
|
||||
-- resize current window using control + 7,8,9,0
|
||||
function M.Resize_Current_Window(change_width, change_height)
|
||||
local width = vim.api.nvim_win_get_width(0)
|
||||
local height = vim.api.nvim_win_get_height(0)
|
||||
|
||||
if width + change_width > 5 then
|
||||
vim.api.nvim_win_set_width(0, width + change_width)
|
||||
end
|
||||
|
||||
if height + change_height > 5 then
|
||||
vim.api.nvim_win_set_height(0, height + change_height)
|
||||
end
|
||||
end
|
||||
|
||||
-- Keybindings
|
||||
-- 7/8 change width
|
||||
-- 9/0 change height
|
||||
--vim.keymap.set("n", "<C-7>", Resize_Current_Window(-1, 0))
|
||||
--vim.keymap.set("n", "<C-8>", Resize_Current_Window(1, 0))
|
||||
--vim.keymap.set("n", "<C-9>", Resize_Current_Window(0, -1))
|
||||
--vim.keymap.set("n", "<C-0>", Resize_Current_Window(0, 1))
|
||||
|
||||
return M
|
||||
@@ -1,69 +0,0 @@
|
||||
-- UltiSnips Configuration
|
||||
vim.g.UltiSnipsExpandTrigger = "<tab>"
|
||||
vim.g.UltiSnipsJumpForwardTrigger = "<c-l>"
|
||||
vim.g.UltiSnipsJumpBackwardTrigger = "<c-h>"
|
||||
vim.g.UltiSnipsEditSplit = "vertical"
|
||||
vim.g.UltiSnipsSnippetDirectories = { "~/.config/nvim/UltiSnips" }
|
||||
|
||||
-- NERDTree Config
|
||||
vim.g.NERDTreeShowHidden = 1
|
||||
|
||||
-- Lexima
|
||||
vim.g.lexima_enable_basic_rules = 1
|
||||
vim.g.lexima_enable_newline_rules = 1
|
||||
|
||||
-- Telescope snippet
|
||||
local builtin = require("telescope.builtin")
|
||||
vim.keymap.set("n", "<leader>ff", builtin.find_files, {})
|
||||
vim.keymap.set("n", "<leader>fg", builtin.live_grep, {})
|
||||
vim.keymap.set("n", "<c-f>", builtin.current_buffer_fuzzy_find, {})
|
||||
vim.keymap.set("n", "<leader>fh", builtin.help_tags, {})
|
||||
vim.keymap.set("n", "<leader>fc", builtin.commands, {})
|
||||
|
||||
-- Telescope + Ultisnips
|
||||
require("telescope").load_extension("ultisnips")
|
||||
vim.keymap.set("n", "<leader>fs", require("telescope").extensions.ultisnips.ultisnips, {})
|
||||
|
||||
-- NERDTree Config
|
||||
vim.g.NERDTreeDirArrowExpandable = "▸"
|
||||
vim.g.NERDTreeDirArrowCollapsible = "▾"
|
||||
|
||||
-- Git-Blame configuration
|
||||
vim.g.gitblame_message_template = " => <author> • <date> • <summary>"
|
||||
vim.g.gitblame_date_format = "%r"
|
||||
|
||||
-- Intendation basics
|
||||
require("ibl").setup()
|
||||
|
||||
-- Code completion
|
||||
require("code-completion")
|
||||
|
||||
-- Mason setup
|
||||
require("mason").setup(require("mason").setup({
|
||||
ui = {
|
||||
icons = {
|
||||
package_installed = "✓",
|
||||
package_pending = "➜",
|
||||
package_uninstalled = "✗",
|
||||
},
|
||||
},
|
||||
}))
|
||||
|
||||
require("mason-lspconfig").setup({
|
||||
-- ensure_installed = { "clangd", "cmake", "jdtls", "texlab", "pylsp" },
|
||||
})
|
||||
|
||||
require("mason-lspconfig").setup_handlers({
|
||||
function(clangd)
|
||||
require("lspconfig")[clangd].setup({})
|
||||
end,
|
||||
["als"] = function()
|
||||
require("lspconfig").als.setup({
|
||||
settings = {
|
||||
ada = {
|
||||
projectFile = "default.gpr",
|
||||
},
|
||||
},
|
||||
})
|
||||
end,
|
||||
})
|
||||
@@ -1,66 +0,0 @@
|
||||
return {
|
||||
"preservim/nerdtree",
|
||||
"Xuyuanp/nerdtree-git-plugin",
|
||||
"SirVer/UltiSnips",
|
||||
"tpope/vim-surround",
|
||||
"vim-airline/vim-airline",
|
||||
"vim-airline/vim-airline-themes",
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
build = ":TSUpdate",
|
||||
config = function()
|
||||
local configs = require("nvim-treesitter.configs")
|
||||
|
||||
configs.setup({
|
||||
-- ensure_installed = { "c", "vim", "ada", "html", "python" },
|
||||
sync_install = false,
|
||||
highlight = { enable = true },
|
||||
indent = { enable = true },
|
||||
})
|
||||
end,
|
||||
},
|
||||
"f-person/git-blame.nvim",
|
||||
"p00f/nvim-ts-rainbow",
|
||||
"cohama/lexima.vim",
|
||||
"ryanoasis/vim-devicons",
|
||||
{
|
||||
"nvim-telescope/telescope.nvim",
|
||||
tag = "0.1.5",
|
||||
dependencies = { "nvim-lua/plenary.nvim" },
|
||||
},
|
||||
"fhill2/telescope-ultisnips.nvim",
|
||||
"hiroakis/cyberspace.vim",
|
||||
"tpope/vim-speeddating",
|
||||
"yannickreiss/nvim-doxyscan",
|
||||
"nvim-tree/nvim-web-devicons",
|
||||
{ "romgrk/barbar.nvim", wants = "nvim-web-devicons" },
|
||||
{ "lukas-reineke/indent-blankline.nvim", main = "ibl", opts = {} },
|
||||
"dstein64/vim-startuptime",
|
||||
"mhinz/vim-startify",
|
||||
"folke/tokyonight.nvim",
|
||||
"patstockwell/vim-monokai-tasty",
|
||||
"hrsh7th/nvim-cmp",
|
||||
"hrsh7th/cmp-nvim-lsp",
|
||||
"hrsh7th/cmp-nvim-lua",
|
||||
"hrsh7th/cmp-nvim-lsp-signature-help",
|
||||
"hrsh7th/cmp-path",
|
||||
"hrsh7th/cmp-buffer",
|
||||
"hrsh7th/cmp-calc",
|
||||
"hrsh7th/cmp-cmdline",
|
||||
"dmitmel/cmp-cmdline-history",
|
||||
"amarakon/nvim-cmp-lua-latex-symbols",
|
||||
"f3fora/cmp-spell",
|
||||
{ "petertriho/cmp-git", requires = "nvim-lua/plenary.nvim" },
|
||||
"williamboman/mason.nvim",
|
||||
"williamboman/mason-lspconfig.nvim",
|
||||
"neovim/nvim-lspconfig",
|
||||
"mfussenegger/nvim-dap",
|
||||
"mhartington/formatter.nvim",
|
||||
"mg979/vim-visual-multi",
|
||||
{ "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",
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
-- in tools.lua
|
||||
local api = vim.api
|
||||
|
||||
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;
|
||||
|
||||
|
||||
|
||||
return M;
|
||||
@@ -1,15 +0,0 @@
|
||||
vim.opt.number = true
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.showmatch = true
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.hlsearch = true
|
||||
vim.opt.encoding = "UTF-8"
|
||||
vim.g.tex_flavor = "latex"
|
||||
vim.opt.conceallevel = 2
|
||||
vim.opt.guifont = "DroidSansMono Nerd Font 11"
|
||||
vim.g.mapleader = ","
|
||||
|
||||
-- set color scheme
|
||||
vim.opt.termguicolors = true
|
||||
Reference in New Issue
Block a user