Compare commits

..

No commits in common. "main" and "master" have entirely different histories.
main ... master

17 changed files with 143 additions and 1149 deletions

2
.gitignore vendored
View File

@ -1,2 +0,0 @@
plugin/packer_compiled.lua
*.spl

View File

@ -1,9 +0,0 @@
-- remap leader to <space>
vim.g.mapleader = ' '
-- Sensible defaults
require('settings')
require('plugins')
require('theme')
require('lsp')
require('keymappings')

143
init.vim Normal file
View File

@ -0,0 +1,143 @@
call plug#begin('~/.local/share/nvim/plugged')
Plug 'davidhalter/jedi-vim'
Plug 'ncm2/float-preview.nvim'
Plug 'dense-analysis/ale'
Plug 'jacoborus/tender.vim'
Plug 'vim-airline/vim-airline'
Plug 'vim-airline/vim-airline-themes'
Plug 'airblade/vim-gitgutter'
Plug 'scrooloose/nerdtree'
Plug 'gleam-lang/gleam.vim'
Plug 'cespare/vim-toml'
Plug 'rust-lang/rust.vim'
Plug 'vim-scripts/DrawIt'
call plug#end()
let g:airline_theme='papercolor'
let g:airline#extensions#ale#enabled=1
inoremap <expr><tab> pumvisible() ? "\<C-n>" : "\<tab>"
inoremap <expr><S-Tab> pumvisible() ? "\<C-p>" : "\<S-TAB>"
let g:jedi#completions_enabled=0
let g:jedi#use_splits_not_buffers="right"
" Preview window is floating
let g:float_preview#docked=0
let g:float_preview#max_width=100
let g:float_preview#max_height=150
let g:float_preview#auto_close=0
set tabstop=4
set softtabstop=4
set shiftwidth=4
set textwidth=79
set expandtab
set autoindent
set fileformat=unix
set number
" Hide top preview window, use float_preview instead
set completeopt-=preview
" Enable folding on indent
set foldmethod=indent
set foldlevel=79
set omnifunc=ale#completion#OmniFunc
" Lint and check types
let b:ale_linters={
\ 'python': ['mypy', 'pyls', 'pylint'],
\ 'ocaml': ['merlin'],
\ 'rust': ['analyzer', 'cargo']
\ }
let b:ale_fixers = {
\ 'rust': ['rustfmt'],
\ 'python': ['autopep8'],
\ 'ocaml': ['ocamlformat']
\}
let g:ale_rust_rustfmt_options='--edition 2018'
let g:ale_fix_on_save=1
let g:ale_lint_on_save=1
let g:ale_lint_on_enter=0
let g:ale_list_window_size=20
" Use .venv as a global default
let g:ale_virtualenv_dir_names=['.venv']
let g:ale_completion_enabled=1
let g:ale_sign_error="✗"
let g:ale_sign_warning="⚠"
let g:ale_echo_msg_error_str = 'E'
let g:ale_echo_msg_warning_str = 'W'
let g:ale_echo_msg_format = '[%linter%] %s [%severity%]'
" Enable warnings about trailing whitespace for all files.
let b:ale_warn_about_trailing_whitespace=1
nmap <leader>e :ALEDetail<CR>
noremap <leader>d :ALEGoToDefinition<CR>
noremap g] :ALEGoToDefinition<CR>
noremap <leader>h :ALEHover<CR>
" ALE colors
highlight ALEError ctermbg=DarkRed ctermfg=Black
highlight ALEWarning ctermbg=Yellow ctermfg=White
" Use TAB to switch between buffers
noremap <tab> :bn<CR>
noremap <S-tab> :bp<CR>
" Highlight trailing whitespace (darker red) and remove all with Ctrl+k
highlight WhitespaceEOL ctermbg=red guibg=#ab0d0d
match WhitespaceEOL /\s\+\%#\@<!$/
nnoremap <C-k> :let _s=@/<Bar>:%s/\s\+$//e<Bar>:let @/=_s<Bar><CR>
" Much better with Tomorrow Night Bright color theme set in alacritty
" set background=dark
highlight Search ctermfg=Black
highlight Comment ctermfg=Grey
highlight SignColumn ctermbg=0
highlight LineNr ctermbg=0 ctermfg=248
highlight Folded ctermbg=Green ctermfg=Black
highlight Pmenu ctermbg=gray guibg=gray
highlight GitGutterAdd ctermfg=Green
highlight GitGutterChange ctermfg=Red
highlight GitGutterDelete ctermfg=DarkRed
highlight GitGutterAddLine ctermbg=LightGreen
highlight GitGutterChangeLine ctermbg=Yellow
highlight GitGutterDeleteLine ctermbg=LightRed
highlight GitGutterChangeDeleteLine ctermbg=LightRed
nmap ]h <Plug>(GitGutterNextHunk)
nmap [h <Plug>(GitGutterPrevHunk)
let g:gitgutter_sign_added='+'
let g:gitgutter_sign_modified='±'
let g:gitgutter_sign_removed='-'
let g:gitgutter_sign_removed_first_line='^'
let g:gitgutter_sign_modified_removed='-'
let g:gitgutter_map_keys=0
let g:gitgutter_set_sign_backgrounds=1
" Toggles on different plugins/modes
nmap <F1> :ToggleMouse<CR>
set pastetoggle=<F2>
nmap <F3> :set nonumber!<CR>
nmap <F4> :GitGutterBufferToggle<CR>
nmap <F5> :NERDTreeToggle<CR>
nmap <F6> :GitGutterLineHighlightsToggle<CR>
autocmd FileType yaml setlocal ts=2 sts=2 sw=2 expandtab
" Maintain undo history between sessions
if !isdirectory("/tmp/.vim-undo-dir-vladan")
call mkdir("/tmp/.vim-undo-dir-vladan", "", 0700)
endif
set undodir=/tmp/.vim-undo-dir-vladan
set undofile
" Enable vimrc files per project
set exrc
" Disable unsafe commands in project vimrc
set secure

View File

@ -1,24 +0,0 @@
-- Clear trailing whitespace
vim.keymap.set("n", "<C-w>", "<cmd>let _s=@/<Bar>:%s/\\s\\+$//e<Bar>:let @/=_s<Bar><CR>")
-- Use tab and shift+tab to cycle buffers
vim.keymap.set("n", "<tab>", "<cmd>bn<cr>")
vim.keymap.set("n", "<S-tab>", "<cmd>bp<cr>")
-- Turn spellchecker on and off
vim.keymap.set("n", "<leader>se", "<cmd>setlocal spell spelllang=en_us<cr>")
vim.keymap.set("n", "<leader>sq", "<cmd>setlocal nospell<cr>")
vim.keymap.set("n", "<F3>", "<cmd>set nonumber!<CR>")
vim.keymap.set("n", "<leader>fe", "<cmd>Oil<CR>")
vim.keymap.set("n", ']d', "<cmd>lua vim.diagnostic.goto_next()<CR>")
vim.keymap.set("n", '[d', "<cmd>lua vim.diagnostic.goto_prev()<CR>")
vim.keymap.set("n", "<leader>aa", require("actions-preview").code_actions)
-- Outline!!
vim.keymap.set("n", "<leader>o", "<cmd>Outline<CR>")
-- Close all buffers
vim.keymap.set("n", '<C-S-x>', "<cmd>bufdo bd<CR>")

View File

@ -1,95 +0,0 @@
local common_on_attach = function(client, bufnr)
-- Mappings.
vim.keymap.set("n", "K", "<Cmd>lua vim.lsp.buf.hover()<CR>")
vim.keymap.set("n", "<C-k>", "<cmd>lua vim.lsp.buf.signature_help()<CR>")
vim.keymap.set("n", "<M-k>", "<cmd>lua vim.lsp.buf.type_definition()<CR>")
vim.keymap.set("n", "<M-r>", "<cmd>lua vim.lsp.buf.rename()()<CR>")
vim.keymap.set("n", "<leader>wl", "<cmd>lua print(vim.inspect(vim.lsp.buf.list_workspace_folders()))<CR>")
vim.keymap.set("n", "<leader>wa", "<cmd>lua vim.lsp.buf.add_workspace_folder()<CR>")
vim.keymap.set("n", "<leader>wr", "<cmd>lua vim.lsp.buf.remove_workspace_folder()<CR>")
vim.keymap.set("n", "<leader>r", "<cmd>lua vim.lsp.buf.rename()<CR>")
-- Autoformat on save.
if client.supports_method("textDocument/formatting") then
vim.api.nvim_create_autocmd("BufWritePre", {
buffer = bufnr,
callback = function()
vim.lsp.buf.format()
end,
})
end
-- Use vim's default coloring.
client.server_capabilities.semanticTokensProvider = nil
for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
vim.api.nvim_set_hl(0, group, {})
end
end
local nvim_lsp = require('lspconfig')
local capabilities = vim.lsp.protocol.make_client_capabilities()
-- LSPs
local servers = {
"clangd",
"dartls",
"gleam",
"lua_ls",
"ocamllsp",
"pyright",
"rnix",
"terraformls",
"vimls",
}
for _, lsp in ipairs(servers) do
nvim_lsp[lsp].setup { capabilities = capabilities, on_attach = common_on_attach }
end
nvim_lsp.rust_analyzer.setup({
on_attach = common_on_attach,
capabilities = capabilities,
settings = {
["rust-analyzer"] = {
imports = {
granularity = {
group = "module",
},
prefix = "self",
},
cargo = {
buildScripts = {
enable = true,
},
},
procMacro = {
enable = true
},
checkOnSave = {
command = "clippy",
},
}
}
})
nvim_lsp.ruff.setup({
on_attach = function (client)
common_on_attach(client)
client.server_capabilities.renameProvider = false
client.server_capabilities.hoverProvider = false
end,
init_options = {
settings = {
-- Any extra CLI arguments for `ruff` go here.
args = {}
}
},
})
-- LSP diagnostics.
vim.lsp.handlers["textDocument/publishDiagnostics"] =
vim.lsp.with(vim.lsp.diagnostic.on_publish_diagnostics, {
virtual_text = false,
underline = true,
signs = true,
update_in_insert = false
})

View File

@ -1,115 +0,0 @@
-- Completion plugin config
vim.opt.completeopt = 'menuone,noselect'
local cmp = require('cmp')
local cmp_kinds = {
Text = '',
Method = '󰊕 ',
Function = '󰊕 ',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
}
cmp.setup({
formatting = {
format = function(entry, vim_item)
-- Kind icons
vim_item.kind = string.format('%s %s', cmp_kinds[vim_item.kind], vim_item.kind)
vim_item.menu = ({
buffer = "[Buffer]",
nvim_lsp = "[LSP]",
luasnip = "[LuaSnip]",
nvim_lua = "[Lua]",
latex_symbols = "[LaTeX]",
})[entry.source.name]
return vim_item
end
},
snippet = {
expand = function(args)
local luasnip = require("luasnip")
if not luasnip then
return
end
luasnip.lsp_expand(args.body)
end,
},
window = {
completion = {
border = nil,
},
documentation = {
border = nil,
max_height = 2000,
}
},
completion = {
autocomplete = false,
},
mapping = cmp.mapping.preset.insert({
['<C-b>'] = cmp.mapping.scroll_docs(-4),
['<C-f>'] = cmp.mapping.scroll_docs(4),
['<C-x><C-o>'] = cmp.mapping.complete(),
['<C-e>'] = cmp.mapping.abort(),
-- Accept currently selected item.
-- Set `select` to `false` to only confirm explicitly selected items.
['<CR>'] = cmp.mapping.confirm({ select = false }),
}),
sources = cmp.config.sources(
{
{ name = 'nvim_lsp' },
{ name = 'luasnip' },
},
{
{ name = 'buffer' },
}
)
})
-- Set configuration for specific filetype.
cmp.setup.filetype('gitcommit', {
sources = cmp.config.sources({
{ name = 'git' },
}, {
{ 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' }
})
})

View File

@ -1,66 +0,0 @@
require("flutter-tools").setup {
ui = {
border = "rounded",
notification_style = 'native'
},
decorations = {
statusline = {
app_version = false,
device = false,
project_config = false,
}
},
debugger = {
enabled = false,
run_via_dap = false,
exception_breakpoints = {},
--register_configurations = function(paths)
-- require("dap").configurations.dart = {
-- <put here config that you would find in .vscode/launch.json>
-- }
--end,
},
flutter_path = "/usr/bin/flutter",
flutter_lookup_cmd = nil,
root_patterns = { ".git", "pubspec.yaml" },
fvm = false,
widget_guides = {
enabled = false,
},
closing_tags = {
highlight = "Comment",
prefix = "/ ",
enabled = true,
},
dev_log = {
enabled = true,
notify_errors = false,
open_cmd = "tabedit",
},
dev_tools = {
autostart = false,
auto_open_browser = false,
},
outline = {
open_cmd = "30vnew",
auto_open = false,
},
lsp = {
color = {
enabled = false,
background = false,
background_color = nil,
foreground = false,
virtual_text = false,
virtual_text_str = "",
},
settings = {
showTodos = true,
completeFunctionCalls = true,
-- analysisExcludedFolders = { "<path-to-flutter-sdk-packages>" },
renameFilesWithClasses = "prompt",
enableSnippets = true,
updateImportsOnRename = true,
}
}
}

View File

@ -1,42 +0,0 @@
require('gitsigns').setup {
on_attach = function(bufnr)
local gs = package.loaded.gitsigns
local function map(mode, l, r, opts)
opts = opts or {}
opts.buffer = bufnr
vim.keymap.set(mode, l, r, opts)
end
-- Navigation
map('n', ']c', function()
if vim.wo.diff then return ']c' end
vim.schedule(function() gs.next_hunk() end)
return '<Ignore>'
end, { expr = true })
map('n', '[c', function()
if vim.wo.diff then return '[c' end
vim.schedule(function() gs.prev_hunk() end)
return '<Ignore>'
end, { expr = true })
-- Actions
map('n', '<leader>hs', gs.stage_hunk)
map('n', '<leader>hr', gs.reset_hunk)
map('v', '<leader>hs', function() gs.stage_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
map('v', '<leader>hr', function() gs.reset_hunk { vim.fn.line('.'), vim.fn.line('v') } end)
map('n', '<leader>hS', gs.stage_buffer)
map('n', '<leader>hu', gs.undo_stage_hunk)
map('n', '<leader>hR', gs.reset_buffer)
map('n', '<leader>hp', gs.preview_hunk)
map('n', '<leader>hb', function() gs.blame_line { full = true } end)
map('n', '<leader>tb', gs.toggle_current_line_blame)
map('n', '<leader>hd', gs.diffthis)
map('n', '<leader>hD', function() gs.diffthis('~') end)
map('n', '<leader>td', gs.toggle_deleted)
-- Text object
map({ 'o', 'x' }, 'ih', ':<C-U>Gitsigns select_hunk<CR>')
end
}

View File

@ -1,91 +0,0 @@
require('plugins.packer_setup')
require('packer').startup(function()
-- Packer can manage itself as an optional plugin
use { 'wbthomason/packer.nvim', opt = true }
-- Fuzzy finder
use {
'nvim-telescope/telescope.nvim',
requires = {
{ 'nvim-lua/popup.nvim' },
{ 'nvim-lua/plenary.nvim' },
}
}
-- Autocomplete and snippets
use {
'hrsh7th/nvim-cmp',
requires = {
{ 'hrsh7th/cmp-nvim-lsp' },
{ 'hrsh7th/cmp-buffer' },
{ 'hrsh7th/cmp-path' },
{ 'hrsh7th/cmp-cmdline' },
}
}
use { 'L3MON4D3/LuaSnip',
config = function()
local snippet_path = os.getenv("HOME") .. "/.config/nvim/snippets/"
if not vim.tbl_contains(vim.opt.rtp:get(), snippet_path) then
vim.opt.rtp:append(snippet_path)
end
require("luasnip").config.set_config({
history = true,
updateevents = "TextChanged,TextChangedI",
delete_check_events = "TextChanged,InsertLeave",
})
require("luasnip.loaders.from_lua").lazy_load()
require("luasnip.loaders.from_vscode").lazy_load()
require("luasnip.loaders.from_snipmate").lazy_load()
end,
requires = {
{ "rafamadriz/friendly-snippets" },
{ 'saadparwaiz1/cmp_luasnip' },
{ "benfowler/telescope-luasnip.nvim" },
},
}
-- Statusbar, colors and syntax
use { 'vim-airline/vim-airline' }
use { 'vim-airline/vim-airline-themes' }
-- LSP and related
use { 'neovim/nvim-lspconfig' }
use { 'aznhe21/actions-preview.nvim' }
use { 'folke/trouble.nvim' } -- lsp diagnostics
-- Plugins to extend builtin language support
use { 'cespare/vim-toml' }
use { 'gleam-lang/gleam.vim' }
use { 'rust-lang/rust.vim' }
use { 'folke/neodev.nvim' }
use { 'hashivim/vim-terraform' }
-- Git
use {
'NeogitOrg/neogit',
requires = {
{ "nvim-lua/plenary.nvim" },
{ "sindrets/diffview.nvim" },
},
}
use { "lewis6991/gitsigns.nvim" }
-- Filesystem browser
use { 'stevearc/oil.nvim' }
-- Misc
use { 'jbyuki/venn.nvim' } -- ascii diagrams
use { 'hedyhli/outline.nvim' }
end)
require('plugins.cmp')
require('plugins.gitsigns')
require('plugins.neogit')
require('plugins.oil')
require('plugins.telescope')
require('plugins.venn')
require("outline").setup({})

View File

@ -1,301 +0,0 @@
local neogit = require('neogit')
vim.keymap.set('n', '<C-S-g>', neogit.open, {})
neogit.setup {
-- Hides the hints at the top of the status buffer
disable_hint = false,
-- Disables changing the buffer highlights based on where the cursor is.
disable_context_highlighting = false,
-- Disables signs for sections/items/hunks
disable_signs = false,
-- Changes what mode the Commit Editor starts in. `true` will leave nvim in normal mode, `false` will change nvim to
-- insert mode, and `"auto"` will change nvim to insert mode IF the commit message is empty, otherwise leaving it in
-- normal mode.
disable_insert_on_commit = "auto",
-- When enabled, will watch the `.git/` directory for changes and refresh the status buffer in response to filesystem
-- events.
filewatcher = {
interval = 1000,
enabled = true,
},
-- "ascii" is the graph the git CLI generates
-- "unicode" is the graph like https://github.com/rbong/vim-flog
graph_style = "ascii",
-- Used to generate URL's for branch popup action "pull request".
git_services = {
["github.com"] = "https://github.com/${owner}/${repository}/compare/${branch_name}?expand=1",
["bitbucket.org"] = "https://bitbucket.org/${owner}/${repository}/pull-requests/new?source=${branch_name}&t=1",
["gitlab.com"] = "https://gitlab.com/${owner}/${repository}/merge_requests/new?merge_request[source_branch]=${branch_name}",
},
-- Allows a different telescope sorter. Defaults to 'fuzzy_with_index_bias'. The example below will use the native fzf
-- sorter instead. By default, this function returns `nil`.
telescope_sorter = function()
return require("telescope").extensions.fzf.native_fzf_sorter()
end,
-- Persist the values of switches/options within and across sessions
remember_settings = true,
-- Scope persisted settings on a per-project basis
use_per_project_settings = true,
-- Table of settings to never persist. Uses format "Filetype--cli-value"
ignored_settings = {
"NeogitPushPopup--force-with-lease",
"NeogitPushPopup--force",
"NeogitPullPopup--rebase",
"NeogitCommitPopup--allow-empty",
"NeogitRevertPopup--no-edit",
},
-- Configure highlight group features
highlight = {
italic = true,
bold = true,
underline = true
},
-- Set to false if you want to be responsible for creating _ALL_ keymappings
use_default_keymaps = true,
-- Neogit refreshes its internal state after specific events, which can be expensive depending on the repository size.
-- Disabling `auto_refresh` will make it so you have to manually refresh the status after you open it.
auto_refresh = true,
-- Value used for `--sort` option for `git branch` command
-- By default, branches will be sorted by commit date descending
-- Flag description: https://git-scm.com/docs/git-branch#Documentation/git-branch.txt---sortltkeygt
-- Sorting keys: https://git-scm.com/docs/git-for-each-ref#_options
sort_branches = "-committerdate",
-- Change the default way of opening neogit
kind = "tab",
-- Disable line numbers and relative line numbers
disable_line_numbers = true,
-- The time after which an output console is shown for slow running commands
console_timeout = 2000,
-- Automatically show console if a command takes more than console_timeout milliseconds
auto_show_console = true,
-- Automatically close the console if the process exits with a 0 (success) status
auto_close_console = true,
status = {
show_head_commit_hash = true,
recent_commit_count = 10,
HEAD_padding = 10,
HEAD_folded = false,
mode_padding = 3,
mode_text = {
M = "modified",
N = "new file",
A = "added",
D = "deleted",
C = "copied",
U = "updated",
R = "renamed",
DD = "unmerged",
AU = "unmerged",
UD = "unmerged",
UA = "unmerged",
DU = "unmerged",
AA = "unmerged",
UU = "unmerged",
["?"] = "",
},
},
commit_editor = {
kind = "tab",
show_staged_diff = true,
-- Accepted values:
-- "split" to show the staged diff below the commit editor
-- "vsplit" to show it to the right
-- "split_above" Like :top split
-- "vsplit_left" like :vsplit, but open to the left
-- "auto" "vsplit" if window would have 80 cols, otherwise "split"
staged_diff_split_kind = "split"
},
commit_select_view = {
kind = "tab",
},
commit_view = {
kind = "vsplit",
verify_commit = vim.fn.executable("gpg") == 1, -- Can be set to true or false, otherwise we try to find the binary
},
log_view = {
kind = "tab",
},
rebase_editor = {
kind = "auto",
},
reflog_view = {
kind = "tab",
},
merge_editor = {
kind = "auto",
},
tag_editor = {
kind = "auto",
},
preview_buffer = {
kind = "split",
},
popup = {
kind = "split",
},
signs = {
-- { CLOSED, OPENED }
hunk = { "", "" },
item = { ">", "v" },
section = { ">", "v" },
},
-- Each Integration is auto-detected through plugin presence, however, it can be disabled by setting to `false`
integrations = {
-- If enabled, use telescope for menu selection rather than vim.ui.select.
-- Allows multi-select and some things that vim.ui.select doesn't.
telescope = nil,
-- Neogit only provides inline diffs. If you want a more traditional way to look at diffs, you can use `diffview`.
-- The diffview integration enables the diff popup.
--
-- Requires you to have `sindrets/diffview.nvim` installed.
diffview = nil,
-- If enabled, uses fzf-lua for menu selection. If the telescope integration
-- is also selected then telescope is used instead
-- Requires you to have `ibhagwan/fzf-lua` installed.
fzf_lua = nil,
},
sections = {
-- Reverting/Cherry Picking
sequencer = {
folded = false,
hidden = false,
},
untracked = {
folded = false,
hidden = false,
},
unstaged = {
folded = false,
hidden = false,
},
staged = {
folded = false,
hidden = false,
},
stashes = {
folded = true,
hidden = false,
},
unpulled_upstream = {
folded = true,
hidden = false,
},
unmerged_upstream = {
folded = false,
hidden = false,
},
unpulled_pushRemote = {
folded = true,
hidden = false,
},
unmerged_pushRemote = {
folded = false,
hidden = false,
},
recent = {
folded = true,
hidden = false,
},
rebase = {
folded = true,
hidden = false,
},
},
mappings = {
commit_editor = {
["q"] = "Close",
["<c-c><c-c>"] = "Submit",
["<c-c><c-k>"] = "Abort",
},
commit_editor_I = {
["<c-c><c-c>"] = "Submit",
["<c-c><c-k>"] = "Abort",
},
rebase_editor = {
["p"] = "Pick",
["r"] = "Reword",
["e"] = "Edit",
["s"] = "Squash",
["f"] = "Fixup",
["x"] = "Execute",
["d"] = "Drop",
["b"] = "Break",
["q"] = "Close",
["<cr>"] = "OpenCommit",
["gk"] = "MoveUp",
["gj"] = "MoveDown",
["<c-c><c-c>"] = "Submit",
["<c-c><c-k>"] = "Abort",
["[c"] = "OpenOrScrollUp",
["]c"] = "OpenOrScrollDown",
},
rebase_editor_I = {
["<c-c><c-c>"] = "Submit",
["<c-c><c-k>"] = "Abort",
},
finder = {
["<cr>"] = "Select",
["<c-c>"] = "Close",
["<esc>"] = "Close",
["<c-n>"] = "Next",
["<c-p>"] = "Previous",
["<down>"] = "Next",
["<up>"] = "Previous",
["<tab>"] = "MultiselectToggleNext",
["<s-tab>"] = "MultiselectTogglePrevious",
["<c-j>"] = "NOP",
},
-- Setting any of these to `false` will disable the mapping.
popup = {
["?"] = "HelpPopup",
["A"] = "CherryPickPopup",
["D"] = "DiffPopup",
["M"] = "RemotePopup",
["P"] = "PushPopup",
["X"] = "ResetPopup",
["Z"] = "StashPopup",
["b"] = "BranchPopup",
["B"] = "BisectPopup",
["c"] = "CommitPopup",
["f"] = "FetchPopup",
["l"] = "LogPopup",
["m"] = "MergePopup",
["p"] = "PullPopup",
["r"] = "RebasePopup",
["v"] = "RevertPopup",
["w"] = "WorktreePopup",
},
status = {
["k"] = "MoveUp",
["j"] = "MoveDown",
["q"] = "Close",
["o"] = "OpenTree",
["I"] = "InitRepo",
["1"] = "Depth1",
["2"] = "Depth2",
["3"] = "Depth3",
["4"] = "Depth4",
["<tab>"] = "Toggle",
["x"] = "Discard",
["s"] = "Stage",
["S"] = "StageUnstaged",
["<c-s>"] = "StageAll",
["K"] = "Untrack",
["u"] = "Unstage",
["U"] = "UnstageStaged",
["$"] = "CommandHistory",
["Y"] = "YankSelected",
["<c-r>"] = "RefreshBuffer",
["<enter>"] = "GoToFile",
["<c-v>"] = "VSplitOpen",
["<c-x>"] = "SplitOpen",
["<c-t>"] = "TabOpen",
["{"] = "GoToPreviousHunkHeader",
["}"] = "GoToNextHunkHeader",
["[c"] = "OpenOrScrollUp",
["]c"] = "OpenOrScrollDown",
},
},
}

View File

@ -1,164 +0,0 @@
local git_ignored = setmetatable({}, {
__index = function(self, key)
local proc = vim.system(
{ "git", "ls-files", "--ignored", "--exclude-standard", "--others", "--directory" },
{
cwd = key,
text = true,
}
)
local result = proc:wait()
local ret = {}
if result.code == 0 then
for line in vim.gsplit(result.stdout, "\n", { plain = true, trimempty = true }) do
-- Remove trailing slash
line = line:gsub("/$", "")
table.insert(ret, line)
end
end
rawset(self, key, ret)
return ret
end,
})
require('oil').setup({
default_file_explorer = true,
-- Id is automatically added at the beginning, and name at the end
-- See :help oil-columns
columns = {
"icon",
-- "permissions",
-- "size",
-- "mtime",
},
-- Buffer-local options to use for oil buffers
buf_options = {
buflisted = false,
bufhidden = "hide",
},
-- Window-local options to use for oil buffers
win_options = {
wrap = false,
signcolumn = "no",
cursorcolumn = false,
foldcolumn = "0",
spell = false,
list = false,
conceallevel = 3,
concealcursor = "nvic",
},
-- Send deleted files to the trash instead of permanently deleting them (:help oil-trash)
delete_to_trash = false,
-- Skip the confirmation popup for simple operations
skip_confirm_for_simple_edits = false,
-- Change this to customize the command used when deleting to trash
trash_command = "trash-put",
-- Selecting a new/moved/renamed file or directory will prompt you to save changes first
prompt_save_on_select_new_entry = true,
-- Keymaps in oil buffer. Can be any value that `vim.keymap.set` accepts OR a table of keymap
-- options with a `callback` (e.g. { callback = function() ... end, desc = "", nowait = true })
-- Additionally, if it is a string that matches "actions.<name>",
-- it will use the mapping at require("oil.actions").<name>
-- Set to `false` to remove a keymap
-- See :help oil-actions for a list of all available actions
keymaps = {
["g?"] = "actions.show_help",
["<CR>"] = "actions.select",
["<C-s>"] = "actions.select_vsplit",
["<C-h>"] = "actions.select_split",
["<C-t>"] = "actions.select_tab",
["<C-p>"] = "actions.preview",
["<C-c>"] = "actions.close",
["<C-l>"] = "actions.refresh",
["-"] = "actions.parent",
["_"] = "actions.open_cwd",
["`"] = "actions.cd",
["~"] = "actions.tcd",
["gs"] = "actions.change_sort",
["gx"] = "actions.open_external",
["g."] = "actions.toggle_hidden",
},
-- Set to false to disable all of the above keymaps
use_default_keymaps = true,
view_options = {
-- Show files and directories that start with "."
show_hidden = true,
-- This function defines what is considered a "hidden" file
is_hidden_file = function(name, _)
if vim.startswith(name, ".") then
return true
end
local dir = require("oil").get_current_dir()
-- if no local directory (e.g. for ssh connections), always show
if not dir then
return false
end
-- return vim.list_contains(git_ignored[dir], name)
end,
-- This function defines what will never be shown, even when `show_hidden` is set
is_always_hidden = function(name, bufnr)
return false
end,
sort = {
-- sort order can be "asc" or "desc"
-- see :help oil-columns to see which columns are sortable
{ "type", "asc" },
{ "name", "asc" },
},
},
-- Configuration for the floating window in oil.open_float
float = {
-- Padding around the floating window
padding = 2,
max_width = 0,
max_height = 0,
border = "rounded",
win_options = {
winblend = 0,
},
-- This is the config that will be passed to nvim_open_win.
-- Change values here to customize the layout
override = function(conf)
return conf
end,
},
-- Configuration for the actions floating preview window
preview = {
-- Width dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_width and max_width can be a single value or a list of mixed integer/float types.
-- max_width = {100, 0.8} means "the lesser of 100 columns or 80% of total"
max_width = 0.9,
-- min_width = {40, 0.4} means "the greater of 40 columns or 40% of total"
min_width = { 40, 0.4 },
-- optionally define an integer/float for the exact width of the preview window
width = nil,
-- Height dimensions can be integers or a float between 0 and 1 (e.g. 0.4 for 40%)
-- min_height and max_height can be a single value or a list of mixed integer/float types.
-- max_height = {80, 0.9} means "the lesser of 80 columns or 90% of total"
max_height = 0.9,
-- min_height = {5, 0.1} means "the greater of 5 columns or 10% of total"
min_height = { 5, 0.1 },
-- optionally define an integer/float for the exact height of the preview window
height = nil,
border = "rounded",
win_options = {
winblend = 0,
},
},
-- Configuration for the floating progress window
progress = {
max_width = 0.9,
min_width = { 40, 0.4 },
width = nil,
max_height = { 10, 0.9 },
min_height = { 5, 0.1 },
height = nil,
border = "rounded",
minimized_border = "none",
win_options = {
winblend = 0,
},
},
})

View File

@ -1,9 +0,0 @@
-- Auto install packer.nvim if not exists
local install_path = vim.fn.stdpath('data') .. '/site/pack/packer/opt/packer.nvim'
if vim.fn.empty(vim.fn.glob(install_path)) > 0 then
vim.api.nvim_command('!git clone https://github.com/wbthomason/packer.nvim ' .. install_path)
end
vim.cmd [[packadd packer.nvim]]
-- Auto compile when there are changes in plugins.lua
vim.cmd 'autocmd BufWritePost plugins.lua PackerCompile'

View File

@ -1,59 +0,0 @@
local telescope = require('telescope')
local actions = require('telescope.actions')
local builtin = require('telescope.builtin')
local telescope_last = 0
function telescope_resume()
if telescope_last == 0 then
telescope_last = 1
builtin.live_grep()
else
builtin.resume()
end
end
telescope.setup {
defaults = {
sorting_strategy = "ascending",
live_grep_arguments = { 'rg',
'--hidden', '--no-ignore', '--color=never',
'--with-filename', '--line-number',
'--column', '--smart-case', '--no-heading',
},
},
pickers = {
live_grep = {
mappings = {
i = { ["<c-f>"] = actions.to_fuzzy_refine },
n = { ["<c-f>"] = telescope_resume },
},
},
find_files = {
cache_picker = false,
},
git_files = {
cache_picker = false,
},
},
}
-- Snippets can be useful.
vim.keymap.set('n', '<leader>ss', telescope.extensions.luasnip.luasnip, {})
-- Fuzzy * files, symbols, buffers, help, etc.
vim.keymap.set('n', '<leader>fa', builtin.find_files) -- f[ind]a[ll]
vim.keymap.set('n', '<leader>fb', builtin.buffers)
vim.keymap.set('n', '<leader>fd', builtin.diagnostics)
vim.keymap.set('n', '<leader>ff', builtin.git_files)
vim.keymap.set('n', '<leader>fh', builtin.help_tags)
vim.keymap.set('n', '<leader>fs', builtin.lsp_dynamic_workspace_symbols)
-- Grep (the only one).
vim.keymap.set('n', '<leader>gg', builtin.live_grep)
-- LSP navigation.
vim.keymap.set('n', '<leader>gd', builtin.lsp_definitions)
vim.keymap.set('n', '<leader>gr', builtin.lsp_references)
vim.keymap.set('n', '<leader>gi', builtin.lsp_implementations)
vim.keymap.set('n', '<leader>ci', builtin.lsp_incoming_calls)
vim.keymap.set('n', '<leader>co', builtin.lsp_outgoing_calls)

View File

@ -1,22 +0,0 @@
-- venn.nvim: enable or disable keymappings
function _G.Toggle_venn()
local venn_enabled = vim.inspect(vim.b.venn_enabled)
if venn_enabled == "nil" then
vim.b.venn_enabled = true
vim.cmd [[setlocal ve=all]]
-- draw a line on HJKL keystokes
vim.api.nvim_buf_set_keymap(0, "n", "J", "<C-v>j:VBox<CR>", { noremap = true })
vim.api.nvim_buf_set_keymap(0, "n", "K", "<C-v>k:VBox<CR>", { noremap = true })
vim.api.nvim_buf_set_keymap(0, "n", "L", "<C-v>l:VBox<CR>", { noremap = true })
vim.api.nvim_buf_set_keymap(0, "n", "H", "<C-v>h:VBox<CR>", { noremap = true })
-- draw a box by pressing "f" with visual selection
vim.api.nvim_buf_set_keymap(0, "v", "f", ":VBox<CR>", { noremap = true })
else
vim.cmd [[setlocal ve=]]
vim.cmd [[mapclear <buffer>]]
vim.b.venn_enabled = nil
end
end
-- toggle keymappings for venn using <leader>v
vim.api.nvim_set_keymap('n', '<leader>v', ":lua Toggle_venn()<CR>", { noremap = true })

View File

@ -1,39 +0,0 @@
local indent = 4
vim.opt.shiftwidth = indent
vim.opt.tabstop = indent
vim.opt.softtabstop = indent
vim.opt.scrolloff = indent
vim.opt.wildmode = 'list:longest,list:full'
vim.opt.expandtab = true
vim.opt.smartindent = true
vim.opt.hidden = true
vim.opt.ignorecase = true
vim.opt.shiftround = true
vim.opt.smartcase = true
vim.opt.splitbelow = true
vim.opt.splitright = true
vim.opt.number = true
vim.opt.clipboard = 'unnamed,unnamedplus'
vim.opt.autoindent = false
vim.opt.smartindent = false
vim.opt.errorformat:prepend('%f|%l col %c|%m')
vim.opt.fileformat = 'unix'
vim.opt.undofile = true
vim.opt.background = 'light'
-- Enable vimrc files per project and disable unsafe commands in project vimrc
vim.opt.exrc = true
vim.opt.secure = true
vim.cmd([[
syntax enable
filetype plugin indent on
set noautoread
autocmd CursorHold * checktime
autocmd TextYankPost * lua vim.highlight.on_yank {on_visual = false}
autocmd BufRead,BufNewFile *.bu,*.yml.example,*.yaml.example set filetype=yaml
autocmd BufRead,BufNewFile *.ign set filetype=json
]])

View File

@ -1,17 +0,0 @@
-- Revert to vim's default term colorscheme
vim.cmd 'colorscheme vim'
vim.cmd 'set notermguicolors'
-- Highlight trailing whitespace (darker red)
vim.cmd 'highlight WhitespaceEOL ctermbg=red guibg=#ab0d0d'
vim.cmd 'match WhitespaceEOL /\\s\\+\\%#\\@<!$/'
vim.cmd 'highlight Visual cterm=bold ctermbg=Grey ctermfg=none'
vim.cmd 'highlight Search ctermfg=Black'
vim.cmd 'highlight SignColumn ctermbg=none'
vim.cmd 'highlight LineNr ctermbg=none ctermfg=LightGrey'
vim.cmd 'highlight Folded ctermbg=LightGrey ctermfg=Black'
vim.cmd 'highlight Pmenu ctermbg=253 ctermfg=Black'
vim.cmd 'let g:airline_theme=\'papercolor\''
vim.g.code_action_menu_window_border = 'single'

View File

@ -1,94 +0,0 @@
Ansible
AWS
GCP
OpenStack
CouchDB
gRPC
Proto
Cap'n
Protobuf
RabbitMQ
MQTT
ZMQ
NoSQL
PostgreSQL
hackerspace
FOSS
NGO
OSTree
CoreOS
distro
selfhosted
Gitea
toolset
Django
AsyncIO
async
FastAPI
gevent
uWSGI
SqlAlchemy
uWSGI's
Podman
Kubernetes
WebAssembly
esp32
SRE
Postgres
Clickhouse
Mysql
Opensearch
Ericssons
Linköping
LabOps
Ericsson
Gerrit
Seavus
Hortonworks
Ambari
Telecommution
HDFS
TradeCore
frontend
GitLab
ElasticSearch
Celerry
Itekako
scalable
JSON
RPC
TinyRPC
FFMpeg
Live555
dockerizing
RedHat
Asseko
MSSQL
Aiven
C2
Vladan
Popovic
pagenumbering
Bulevar
Oslobodjenja
gmail
vladanovic/!
vladanovic
microservice
transcoding
Tox
Jinja2
Artifactory
ESP32
Microcontroller
SIM800L
blox
NEO
A7670E
TCP
adminstrator
devops
COVID
microcontrollers
codebases
OCaml