Compare commits
94 Commits
Author | SHA1 | Date |
---|---|---|
Vladan Popovic | 422ecf0308 | |
Vladan Popovic | eccbfcbea2 | |
Vladan Popovic | 7d6b3e53c4 | |
Vladan Popovic | a1a4dc927e | |
Vladan Popovic | 637fed3f6b | |
Vladan Popovic | 044ed9117f | |
Vladan Popovic | c99606d4ee | |
Vladan Popovic | c0e15e1141 | |
Vladan Popovic | d7f591fd26 | |
Vladan Popovic | 3e6923583f | |
Vladan Popovic | 022660396e | |
Vladan Popovic | 5c8e114e44 | |
Vladan Popovic | b3b051355a | |
Vladan Popovic | 9a29f15556 | |
Vladan Popovic | 2efe116082 | |
Vladan Popovic | e42d6245a5 | |
Vladan Popovic | fd32c079c9 | |
Vladan Popovic | 0e55059a63 | |
Vladan Popovic | fa255704a1 | |
Vladan Popovic | 7ca16fc0bf | |
Vladan Popovic | 713c83768b | |
Vladan Popovic | f7e73a3eb3 | |
Vladan Popovic | d79cbd6989 | |
Vladan Popovic | eaaf6db7ad | |
Vladan Popovic | 7a61c5ef16 | |
Vladan Popovic | 64d04c8618 | |
Vladan Popovic | c2c40dbe03 | |
Vladan Popovic | 73d0d7c14d | |
Vladan Popovic | 727a6bcfbc | |
Vladan Popovic | a35b743b62 | |
Vladan Popovic | 8a348282a4 | |
Vladan Popovic | 0fabc551bd | |
Vladan Popovic | b521d84e7f | |
Vladan Popovic | ccbf466c55 | |
Vladan Popovic | dd18c0a9bc | |
Vladan Popovic | df3dc407a7 | |
Vladan Popovic | 6d04ade3e5 | |
Vladan Popovic | 351d1690aa | |
Vladan Popovic | 07d13e67ae | |
Vladan Popovic | 97128cf6e7 | |
Vladan Popovic | e70253835c | |
Vladan Popovic | 1b268b2e77 | |
Vladan Popovic | 65a01e8caa | |
Vladan Popovic | 027c0c81f3 | |
Vladan Popovic | 3e2dd9c332 | |
Vladan Popovic | d89d00af71 | |
Vladan Popovic | 1ecaa1dcf8 | |
Vladan Popovic | 062d618a21 | |
Vladan Popovic | 8437ec67c1 | |
Vladan Popovic | 4496f44c49 | |
Vladan Popovic | 253d536ba4 | |
Vladan Popovic | 15bc48a6c5 | |
Vladan Popovic | ca0b58aeb4 | |
Vladan Popovic | e6e2555274 | |
Vladan Popovic | 994e42f688 | |
Vladan Popovic | 3ad2648482 | |
Vladan Popovic | 2bc591369a | |
Vladan Popovic | 79b517a247 | |
Vladan Popovic | 88e3cb4ead | |
Vladan Popovic | bb552b1482 | |
Vladan Popovic | d6c1fa669a | |
Vladan Popovic | 3d6f14f2ff | |
Vladan Popovic | c41f6a096c | |
Vladan Popovic | 8ab3473583 | |
Vladan Popovic | af32327977 | |
Vladan Popovic | f0b2401c51 | |
Vladan Popovic | 70ee28574e | |
Vladan Popovic | e46e48405e | |
Vladan Popovic | 9b8c24ca69 | |
Vladan Popovic | f90c49b9e2 | |
Vladan Popovic | 721bc03588 | |
Vladan Popovic | 9570523e75 | |
Vladan Popovic | c16858ffc7 | |
Vladan Popovic | f4fa48ed39 | |
Vladan Popovic | 4f4e77d2e8 | |
Vladan Popovic | 97dfc2aa6a | |
Vladan Popovic | b36cad9c7b | |
Vladan Popovic | bee54bc4c5 | |
Vladan Popovic | 2c65a5f0d6 | |
Vladan Popovic | 7b9ca1d26c | |
Vladan Popovic | 319356d0a0 | |
Vladan Popovic | ceddfe4e8f | |
Vladan Popovic | 896451558b | |
Vladan Popovic | 2b9088acbf | |
Vladan Popovic | c8d6c028e8 | |
Vladan Popovic | 178d46f664 | |
Vladan Popovic | e541136af7 | |
Vladan Popovic | 39ad5f0381 | |
Vladan Popovic | d80dd17b48 | |
Vladan Popovic | dbc39e9daa | |
Vladan Popovic | ad462255b2 | |
Vladan Popovic | 446b6ea0bd | |
Vladan Popovic | a6b46bb2c0 | |
Vladan Popovic | f551318edc |
|
@ -0,0 +1,2 @@
|
|||
plugin/packer_compiled.lua
|
||||
*.spl
|
|
@ -0,0 +1,9 @@
|
|||
-- remap leader to <space>
|
||||
vim.g.mapleader = ' '
|
||||
|
||||
-- Sensible defaults
|
||||
require('settings')
|
||||
require('plugins')
|
||||
require('theme')
|
||||
require('lsp')
|
||||
require('keymappings')
|
143
init.vim
143
init.vim
|
@ -1,143 +0,0 @@
|
|||
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
|
|
@ -0,0 +1,24 @@
|
|||
-- 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>")
|
|
@ -0,0 +1,95 @@
|
|||
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
|
||||
})
|
|
@ -0,0 +1,115 @@
|
|||
-- 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' }
|
||||
})
|
||||
})
|
|
@ -0,0 +1,66 @@
|
|||
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,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,42 @@
|
|||
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
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
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({})
|
|
@ -0,0 +1,301 @@
|
|||
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",
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,164 @@
|
|||
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,
|
||||
},
|
||||
},
|
||||
|
||||
})
|
|
@ -0,0 +1,9 @@
|
|||
-- 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'
|
|
@ -0,0 +1,59 @@
|
|||
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)
|
|
@ -0,0 +1,22 @@
|
|||
-- 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 })
|
|
@ -0,0 +1,39 @@
|
|||
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
|
||||
]])
|
|
@ -0,0 +1,17 @@
|
|||
-- 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'
|
|
@ -0,0 +1,94 @@
|
|||
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
|
Loading…
Reference in New Issue