Compare commits
2 Commits
c001aa1a1f
...
d180750c3d
Author | SHA1 | Date |
---|---|---|
Pavle Portic | d180750c3d | |
Pavle Portic | eb0c9c2785 |
|
@ -4,7 +4,7 @@
|
|||
# for running programs. It contains icons for a few programs, but more can
|
||||
# easily be added by inserting them into WINDOW_ICONS below.
|
||||
#
|
||||
# Dependencies: xorg-xprop i3ipc nerdfonts
|
||||
# Dependencies: xorg-xprop i3ipc fontawesome
|
||||
#
|
||||
# Installation:
|
||||
# Add "exec_always ~/.config/i3/i3-autoname-workspaces.py &" to the i3 config
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
{
|
||||
"languageserver": {
|
||||
"terraform": {
|
||||
"command": "terraform-ls",
|
||||
"args": ["serve"],
|
||||
"filetypes": ["terraform", "tf"],
|
||||
"initializationOptions": {},
|
||||
"settings": {}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,34 @@
|
|||
require("sets")
|
||||
|
||||
-- Lazy.nvim
|
||||
local lazypath = vim.fn.stdpath("data") .. "/lazy/lazy.nvim"
|
||||
|
||||
if not vim.loop.fs_stat(lazypath) then
|
||||
vim.fn.system({
|
||||
"git",
|
||||
"clone",
|
||||
"--filter=blob:none",
|
||||
"https://github.com/folke/lazy.nvim.git",
|
||||
"--branch=stable", -- latest stable release
|
||||
lazypath,
|
||||
})
|
||||
end
|
||||
|
||||
vim.opt.rtp:prepend(lazypath)
|
||||
|
||||
require("lazy").setup("plugins", {
|
||||
change_detection = {
|
||||
enabled = true,
|
||||
notify = false,
|
||||
},
|
||||
})
|
||||
|
||||
vim.cmd([[colorscheme gruvbox]])
|
||||
|
||||
require('telescope').load_extension('projects')
|
||||
require('project_nvim').setup({})
|
||||
|
||||
-- Import additional config files
|
||||
require("mappings")
|
||||
require("lsp")
|
||||
require("line")
|
|
@ -0,0 +1,32 @@
|
|||
{
|
||||
"Comment.nvim": { "branch": "master", "commit": "0236521ea582747b58869cb72f70ccfa967d2e89" },
|
||||
"LuaSnip": { "branch": "master", "commit": "0df29db3543837f8b41597f2640397c5ec792b7b" },
|
||||
"bufferline.nvim": { "branch": "main", "commit": "6ecd37e0fa8b156099daedd2191130e083fb1490" },
|
||||
"cmp-nvim-lsp": { "branch": "main", "commit": "44b16d11215dce86f253ce0c30949813c0a90765" },
|
||||
"copilot.vim": { "branch": "release", "commit": "998cf5ab1b85e844c7e8edb864a997e590df7182" },
|
||||
"diffview.nvim": { "branch": "main", "commit": "d38c1b5266850f77f75e006bcc26213684e1e141" },
|
||||
"gitsigns.nvim": { "branch": "main", "commit": "ff01d34daaed72f271a8ffa088a7e839a60c640f" },
|
||||
"gruvbox.nvim": { "branch": "main", "commit": "477c62493c82684ed510c4f70eaf83802e398898" },
|
||||
"lazy.nvim": { "branch": "main", "commit": "276e572f645430bcfd6fd25faa301ea9077f6ab1" },
|
||||
"lsp-zero.nvim": { "branch": "v3.x", "commit": "22d2186bee730d68f6fd3bb2d19a389784c37a96" },
|
||||
"lualine.nvim": { "branch": "master", "commit": "45e27ca739c7be6c49e5496d14fcf45a303c3a63" },
|
||||
"mason-lspconfig.nvim": { "branch": "main", "commit": "397273083f988c1a17acf3816947cd198338e700" },
|
||||
"mason.nvim": { "branch": "main", "commit": "cd7835b15f5a4204fc37e0aa739347472121a54c" },
|
||||
"neodev.nvim": { "branch": "main", "commit": "24b403eabde652904077f84fd55441744e77a109" },
|
||||
"nvim-autopairs": { "branch": "master", "commit": "748e72c05495a3d30e88a6ef04b21697019a9aa9" },
|
||||
"nvim-cmp": { "branch": "main", "commit": "5dce1b778b85c717f6614e3f4da45e9f19f54435" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "bb8e3dfbe10d80c294bb609c4bb4bba3ecdfbfe2" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "0d5c611e3fd36353b11b412661ff4f07bcc8e5c6" },
|
||||
"nvim-treesitter-textobjects": { "branch": "master", "commit": "76c7a89b41de77a4f83fb77fa072c5ad7605fe3b" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "a1e6268779411048a87f767a27380089362a0ce2" },
|
||||
"plenary.nvim": { "branch": "master", "commit": "50012918b2fc8357b87cff2a7f7f0446e47da174" },
|
||||
"project.nvim": { "branch": "main", "commit": "8c6bad7d22eef1b71144b401c9f74ed01526a4fb" },
|
||||
"telescope.nvim": { "branch": "0.1.x", "commit": "7011eaae0ac1afe036e30c95cf80200b8dc3f21a" },
|
||||
"undotree": { "branch": "master", "commit": "0e11ba7325efbbb3f3bebe06213afa3e7ec75131" },
|
||||
"vim-fugitive": { "branch": "master", "commit": "cbe9dfa162c178946afa689dd3f42d4ea8bf89c1" },
|
||||
"vim-matchup": { "branch": "master", "commit": "6dbe108230c7dbbf00555b7d4d9f6a891837ef07" },
|
||||
"vim-repeat": { "branch": "master", "commit": "24afe922e6a05891756ecf331f39a1f6743d3d5a" },
|
||||
"vim-surround": { "branch": "master", "commit": "3d188ed2113431cf8dac77be61b842acb64433d9" },
|
||||
"which-key.nvim": { "branch": "main", "commit": "6962dae3565369363b59dd51fb206051555fcb4d" },
|
||||
"whitespace.nvim": { "branch": "master", "commit": "f0fc9e9c4ce3f7d2166e9e5a069b64b9ca4a3f15" }
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
require("lualine").setup({
|
||||
options = {
|
||||
icons_enabled = true,
|
||||
theme = 'gruvbox',
|
||||
component_separators = { left = '', right = ''},
|
||||
section_separators = { left = '', right = ''},
|
||||
disabled_filetypes = {
|
||||
statusline = {},
|
||||
winbar = {},
|
||||
},
|
||||
ignore_focus = {},
|
||||
always_divide_middle = true,
|
||||
globalstatus = false,
|
||||
refresh = {
|
||||
statusline = 1000,
|
||||
tabline = 1000,
|
||||
winbar = 1000,
|
||||
},
|
||||
show_filename_only = false,
|
||||
},
|
||||
sections = {
|
||||
lualine_a = {'mode'},
|
||||
lualine_b = {'branch', 'diff', 'diagnostics'},
|
||||
lualine_c = {
|
||||
{
|
||||
'filename',
|
||||
file_status = true, -- Displays file status (readonly status, modified status)
|
||||
newfile_status = false, -- Display new file status (new file means no write after created)
|
||||
path = 1, -- 0: Just the filename
|
||||
-- 1: Relative path
|
||||
-- 2: Absolute path
|
||||
-- 3: Absolute path, with tilde as the home directory
|
||||
-- 4: Filename and parent dir, with tilde as the home directory
|
||||
|
||||
shorting_target = 40, -- Shortens path to leave 40 spaces in the window
|
||||
-- for other components. (terrible name, any suggestions?)
|
||||
symbols = {
|
||||
modified = '[+]', -- Text to show when the file is modified.
|
||||
readonly = '[-]', -- Text to show when the file is non-modifiable or readonly.
|
||||
unnamed = '[No Name]', -- Text to show for unnamed buffers.
|
||||
newfile = '[New]', -- Text to show for newly created file before first write
|
||||
}
|
||||
}
|
||||
},
|
||||
lualine_x = {
|
||||
'filetype',
|
||||
{
|
||||
require("lazy.status").updates,
|
||||
cond = require("lazy.status").has_updates,
|
||||
color = { fg = "#ff9e64" },
|
||||
},
|
||||
},
|
||||
lualine_y = {'progress'},
|
||||
lualine_z = {'location'},
|
||||
},
|
||||
inactive_sections = {
|
||||
lualine_a = {},
|
||||
lualine_b = {},
|
||||
lualine_c = {'filename'},
|
||||
lualine_x = {'location'},
|
||||
lualine_y = {},
|
||||
lualine_z = {},
|
||||
},
|
||||
tabline = {},
|
||||
winbar = {},
|
||||
inactive_winbar = {},
|
||||
extensions = {},
|
||||
})
|
||||
|
||||
|
||||
require("bufferline").setup({
|
||||
options = {
|
||||
mode = "buffers",
|
||||
themable = true,
|
||||
numbers = "ordinal",
|
||||
indicator = {
|
||||
icon = '▎', -- this should be omitted if indicator style is not 'icon'
|
||||
style = 'icon',
|
||||
},
|
||||
modified_icon = '●',
|
||||
close_icon = '',
|
||||
left_trunc_marker = '',
|
||||
right_trunc_marker = '',
|
||||
max_name_length = 24,
|
||||
max_prefix_length = 15, -- prefix used when a buffer is de-duplicated
|
||||
truncate_names = true, -- whether or not tab names should be truncated
|
||||
tab_size = 18,
|
||||
diagnostics = "nvim_lsp",
|
||||
color_icons = true,
|
||||
show_buffer_icons = true,
|
||||
show_buffer_close_icons = false,
|
||||
-- show_close_icon = false,
|
||||
-- show_tab_indicators = true | false,
|
||||
-- show_duplicate_prefix = true | false, -- whether to show duplicate buffer prefix
|
||||
persist_buffer_sort = true, -- whether or not custom sorted buffers should persist
|
||||
move_wraps_at_ends = false, -- whether or not the move command "wraps" at the first or last position
|
||||
-- can also be a table containing 2 custom separators
|
||||
-- [focused and unfocused]. eg: { '|', '|' }
|
||||
-- separator_style = "slant" | "slope" | "thick" | "thin" | { 'any', 'any' },
|
||||
-- enforce_regular_tabs = false | true,
|
||||
always_show_bufferline = true,
|
||||
hover = {
|
||||
enabled = false,
|
||||
},
|
||||
},
|
||||
})
|
|
@ -0,0 +1,50 @@
|
|||
-- Load default lsp-zero keymaps
|
||||
local lsp_zero = require('lsp-zero')
|
||||
|
||||
lsp_zero.on_attach(function(_, bufnr)
|
||||
-- see :help lsp-zero-keybindings
|
||||
-- to learn the available actions
|
||||
lsp_zero.default_keymaps({buffer = bufnr})
|
||||
|
||||
local opts = {buffer = bufnr, remap = false}
|
||||
vim.keymap.set("n", "<leader>vw", function() vim.lsp.buf.workspace_symbol() end, opts)
|
||||
vim.keymap.set("n", "<leader>vc", function() vim.lsp.buf.code_action() end, opts)
|
||||
vim.keymap.set("n", "<leader>vr", function() vim.lsp.buf.rename() end, opts)
|
||||
|
||||
vim.keymap.set("n", "<leader>en", function() vim.diagnostic.goto_next() end, opts)
|
||||
vim.keymap.set("n", "<leader>ep", function() vim.diagnostic.goto_prev() end, opts)
|
||||
vim.keymap.set("i", "<C-h>", function() vim.lsp.buf.signature_help() end, opts)
|
||||
end)
|
||||
|
||||
-- Setup LSP servers
|
||||
local lspconfig = require('lspconfig')
|
||||
|
||||
lspconfig.golangci_lint_ls.setup({})
|
||||
lspconfig.gopls.setup({})
|
||||
lspconfig.lua_ls.setup({})
|
||||
lspconfig.pylsp.setup{}
|
||||
lspconfig.terraformls.setup({})
|
||||
lspconfig.jsonls.setup({})
|
||||
|
||||
-- Customize keymaps
|
||||
local cmp = require('cmp')
|
||||
-- local cmp_action = require('lsp-zero').cmp_action()
|
||||
|
||||
cmp.setup({
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
-- `Enter` key to confirm completion
|
||||
['<CR>'] = cmp.mapping.confirm({select = false}),
|
||||
|
||||
['<C-Space>'] = cmp.mapping.complete(),
|
||||
|
||||
-- Scroll up and down in the completion documentation
|
||||
['<C-u>'] = cmp.mapping.scroll_docs(-4),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(4),
|
||||
})
|
||||
})
|
||||
|
||||
-- Fix lua lsp for nvim config
|
||||
local lua_opts = lsp_zero.nvim_lua_ls()
|
||||
require('lspconfig').lua_ls.setup(lua_opts)
|
||||
|
||||
require("mason").setup()
|
|
@ -0,0 +1,62 @@
|
|||
-- Colemak bindings
|
||||
vim.keymap.set("", "n", "j")
|
||||
vim.keymap.set("", "e", "k")
|
||||
vim.keymap.set("", "i", "l")
|
||||
vim.keymap.set("", "I", "$")
|
||||
vim.keymap.set("", "H", "0")
|
||||
vim.keymap.set("", "l", "i")
|
||||
vim.keymap.set("", "L", "I")
|
||||
vim.keymap.set("n", "N", "mzJ`z")
|
||||
vim.keymap.set("", "k", "n")
|
||||
vim.keymap.set("", "K", "N")
|
||||
vim.keymap.set("", "J", "M")
|
||||
vim.keymap.set("", "j", "m")
|
||||
vim.keymap.set("", "m", "e")
|
||||
vim.keymap.set("", "M", "E")
|
||||
|
||||
vim.keymap.set("v", "N", ":m '>+1<CR>gv=gv")
|
||||
vim.keymap.set("v", "E", ":m '<-2<CR>gv=gv")
|
||||
|
||||
-- General mappings
|
||||
vim.keymap.set("", "<BS>", "gg")
|
||||
vim.keymap.set("", "<CR>", "G")
|
||||
vim.keymap.set("", "<Space>", "<NOP>")
|
||||
|
||||
vim.keymap.set("x", "p", "\"_dP")
|
||||
|
||||
vim.keymap.set("n", "<tab>", vim.cmd.bn)
|
||||
vim.keymap.set("n", "<s-tab>", vim.cmd.bp)
|
||||
vim.keymap.set("n", "U", vim.cmd.redo)
|
||||
|
||||
-- File operation maps
|
||||
vim.keymap.set("n", "<leader>fd", "mzgg=G`z")
|
||||
vim.keymap.set("n", "<leader>fs", vim.cmd.w)
|
||||
vim.keymap.set("n", "<leader>q", vim.cmd.q)
|
||||
vim.keymap.set("n", "<leader>Q", ":q!<cr>")
|
||||
vim.keymap.set("n", "<leader>wq", vim.cmd.wq)
|
||||
vim.keymap.set("n", "<leader>bd", ":bp | bd #<cr>")
|
||||
vim.keymap.set("n", "<leader>u", vim.cmd.UndotreeToggle)
|
||||
|
||||
vim.keymap.set("", "\\", ":let @/ = \"\"<CR>")
|
||||
|
||||
-- Git
|
||||
vim.keymap.set("n", "<leader>gd", vim.cmd.Gvdiff)
|
||||
|
||||
-- window movement
|
||||
vim.keymap.set("n", "<leader>wn", "<C-W>j")
|
||||
vim.keymap.set("n", "<leader>we", "<C-W>k")
|
||||
vim.keymap.set("n", "<leader>wh", "<C-W>h")
|
||||
vim.keymap.set("n", "<leader>wi", "<C-W>l")
|
||||
vim.keymap.set("n", "<leader>wH", "<C-W>5<")
|
||||
vim.keymap.set("n", "<leader>wI", "<C-W>5>")
|
||||
vim.keymap.set("n", "<leader>wN", ":resize +5<CR>")
|
||||
vim.keymap.set("n", "<leader>wE", ":resize -5<CR>")
|
||||
|
||||
-- Telescope
|
||||
local builtin = require('telescope.builtin')
|
||||
vim.keymap.set('n', '<leader>ff', builtin.git_files, {})
|
||||
vim.keymap.set('n', '<leader>fp', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<c-p>', builtin.find_files, {})
|
||||
vim.keymap.set('n', '<leader>rg', builtin.live_grep, {})
|
||||
vim.keymap.set('n', '<leader>fb', builtin.buffers, {})
|
||||
vim.keymap.set('n', '<leader>fh', builtin.help_tags, {})
|
|
@ -0,0 +1,12 @@
|
|||
return {
|
||||
'numToStr/Comment.nvim',
|
||||
opts = {
|
||||
toggler = {
|
||||
---Line-comment toggle keymap
|
||||
line = '<leader>/',
|
||||
---Block-comment toggle keymap
|
||||
block = '<leader>b/',
|
||||
},
|
||||
},
|
||||
lazy = false,
|
||||
}
|
|
@ -0,0 +1,48 @@
|
|||
return {
|
||||
{
|
||||
"lewis6991/gitsigns.nvim",
|
||||
opts = {
|
||||
signs = {
|
||||
add = { text = '│' },
|
||||
change = { text = '│' },
|
||||
delete = { text = '_' },
|
||||
topdelete = { text = '‾' },
|
||||
changedelete = { text = '~' },
|
||||
untracked = { text = '┆' },
|
||||
},
|
||||
signcolumn = true, -- Toggle with `:Gitsigns toggle_signs`
|
||||
numhl = false, -- Toggle with `:Gitsigns toggle_numhl`
|
||||
linehl = false, -- Toggle with `:Gitsigns toggle_linehl`
|
||||
word_diff = false, -- Toggle with `:Gitsigns toggle_word_diff`
|
||||
watch_gitdir = {
|
||||
follow_files = true
|
||||
},
|
||||
attach_to_untracked = true,
|
||||
current_line_blame = false, -- Toggle with `:Gitsigns toggle_current_line_blame`
|
||||
current_line_blame_opts = {
|
||||
virt_text = true,
|
||||
virt_text_pos = 'eol', -- 'eol' | 'overlay' | 'right_align'
|
||||
delay = 1000,
|
||||
ignore_whitespace = false,
|
||||
},
|
||||
current_line_blame_formatter = '<author>, <author_time:%Y-%m-%d> - <summary>',
|
||||
sign_priority = 6,
|
||||
update_debounce = 100,
|
||||
status_formatter = nil, -- Use default
|
||||
max_file_length = 40000, -- Disable if file is longer than this (in lines)
|
||||
preview_config = {
|
||||
-- Options passed to nvim_open_win
|
||||
border = 'single',
|
||||
style = 'minimal',
|
||||
relative = 'cursor',
|
||||
row = 0,
|
||||
col = 1
|
||||
},
|
||||
yadm = {
|
||||
enable = false
|
||||
},
|
||||
}
|
||||
},
|
||||
"sindrets/diffview.nvim",
|
||||
"tpope/vim-fugitive",
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
return {
|
||||
-- Look and feel
|
||||
{
|
||||
"ellisonleao/gruvbox.nvim",
|
||||
priority = 1000 ,
|
||||
config = true,
|
||||
},
|
||||
{
|
||||
'akinsho/bufferline.nvim',
|
||||
version = "*",
|
||||
dependencies = 'nvim-tree/nvim-web-devicons',
|
||||
},
|
||||
"nvim-lualine/lualine.nvim",
|
||||
|
||||
-- keymaps and functionality
|
||||
{
|
||||
'windwp/nvim-autopairs',
|
||||
event = "InsertEnter",
|
||||
opts = {}
|
||||
},
|
||||
"tpope/vim-surround",
|
||||
"folke/which-key.nvim",
|
||||
'andymass/vim-matchup',
|
||||
'tpope/vim-repeat',
|
||||
'mbbill/undotree',
|
||||
'jdhao/whitespace.nvim',
|
||||
|
||||
-- other
|
||||
'ahmedkhalf/project.nvim',
|
||||
'folke/neodev.nvim',
|
||||
'github/copilot.vim',
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
return {
|
||||
{'williamboman/mason.nvim'},
|
||||
{'williamboman/mason-lspconfig.nvim'},
|
||||
|
||||
{'VonHeikemen/lsp-zero.nvim', branch = 'v3.x'},
|
||||
{'neovim/nvim-lspconfig'},
|
||||
{'hrsh7th/cmp-nvim-lsp'},
|
||||
{'hrsh7th/nvim-cmp'},
|
||||
{'L3MON4D3/LuaSnip'},
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
return {
|
||||
'nvim-telescope/telescope.nvim', branch = '0.1.x',
|
||||
dependencies = { 'nvim-lua/plenary.nvim' }
|
||||
}
|
|
@ -0,0 +1,57 @@
|
|||
return {
|
||||
"nvim-treesitter/nvim-treesitter",
|
||||
version = false,
|
||||
build = ":TSUpdate",
|
||||
event = { "BufReadPost", "BufNewFile" },
|
||||
dependencies = {
|
||||
{
|
||||
"nvim-treesitter/nvim-treesitter-textobjects",
|
||||
init = function()
|
||||
require("lazy.core.loader").disable_rtp_plugin("nvim-treesitter-textobjects")
|
||||
load_textobjects = true
|
||||
end,
|
||||
},
|
||||
},
|
||||
cmd = { "TSUpdateSync" },
|
||||
keys = {
|
||||
{ "<c-space>", desc = "Increment selection" },
|
||||
{ "<bs>", desc = "Decrement selection", mode = "x" },
|
||||
},
|
||||
opts = {
|
||||
highlight = {
|
||||
enable = true,
|
||||
additional_vim_regex_highlighting = false,
|
||||
},
|
||||
indent = { enable = true },
|
||||
auto_install = true,
|
||||
ensure_installed = {
|
||||
"bash",
|
||||
"go",
|
||||
"javascript",
|
||||
"json",
|
||||
"lua",
|
||||
"luadoc",
|
||||
"luap",
|
||||
"markdown",
|
||||
"markdown_inline",
|
||||
"python",
|
||||
"query",
|
||||
"regex",
|
||||
"terraform",
|
||||
"tsx",
|
||||
"typescript",
|
||||
"vim",
|
||||
"vimdoc",
|
||||
"yaml",
|
||||
},
|
||||
incremental_selection = {
|
||||
enable = true,
|
||||
keymaps = {
|
||||
init_selection = "<C-space>",
|
||||
node_incremental = "<C-space>",
|
||||
scope_incremental = false,
|
||||
node_decremental = "<bs>",
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
vim.g.mapleader = " "
|
||||
|
||||
-- sets
|
||||
vim.opt.clipboard = "unnamedplus"
|
||||
vim.opt.nu = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.encoding = "utf8"
|
||||
vim.opt.shell = "/bin/bash"
|
||||
vim.opt.laststatus = 2
|
||||
vim.opt.tabstop = 4
|
||||
vim.opt.shiftwidth = 4
|
||||
vim.opt.softtabstop = 4
|
||||
vim.opt.textwidth = 0
|
||||
vim.opt.background = "dark"
|
||||
vim.opt.listchars = "tab:│ ,trail:~,extends:>,precedes:<"
|
||||
vim.opt.foldenable = false
|
||||
vim.opt.foldmethod = "expr"
|
||||
vim.opt.foldexpr = "nvim_treesitter#foldexpr()"
|
||||
vim.opt.termguicolors = true
|
||||
vim.opt.autochdir = true
|
||||
vim.opt.showcmd = true
|
||||
vim.opt.wrap = true
|
||||
vim.opt.linebreak = true
|
||||
vim.opt.number = true
|
||||
vim.opt.relativenumber = true
|
||||
vim.opt.cursorline = true
|
||||
vim.opt.cursorcolumn = true
|
||||
vim.opt.expandtab = true
|
||||
vim.opt.autoindent = true
|
||||
vim.opt.list = true
|
||||
vim.opt.splitright = true
|
||||
vim.opt.splitbelow = true
|
||||
vim.opt.undofile = true
|
||||
vim.opt.undodir = "/home/pavle/.local/share/nvim/undodir"
|
||||
vim.opt.scrolloff = 8
|
||||
vim.opt.ignorecase = true
|
||||
vim.opt.smartcase = true
|
305
dot_spacevim
305
dot_spacevim
|
@ -1,305 +0,0 @@
|
|||
" vim: set ft=vim: syntax=vim
|
||||
" Use exclude option if you don't want the full Layer,
|
||||
" e.g., Layer 'better-defaults', { 'exclude': 'itchyny/vim-cursorword' }
|
||||
function! Layers()
|
||||
let g:spacevim_lsp_engine = 'coc'
|
||||
let g:spacevim_speed_up_via_timer = 0
|
||||
let g:spacevim_enable_startify = 0
|
||||
|
||||
" Polyglot configuration
|
||||
let g:polyglot_disabled = ['systemd']
|
||||
|
||||
Layer 'airline'
|
||||
Layer 'better-defaults', {'exclude': [
|
||||
\ 'kshenoy/vim-signature',
|
||||
\ 'google/vim-searchindex',
|
||||
\ ] }
|
||||
Layer 'docker'
|
||||
Layer 'editing'
|
||||
Layer 'fzf'
|
||||
Layer 'git'
|
||||
Layer 'lsp'
|
||||
Layer 'markdown'
|
||||
Layer 'programming', {'exclude': ['luochen1990/rainbow']}
|
||||
Layer 'unite'
|
||||
Layer 'syntax-checking'
|
||||
|
||||
endfunction
|
||||
|
||||
function! UserInit()
|
||||
|
||||
Plug 'andymass/vim-matchup'
|
||||
Plug 'tpope/vim-repeat'
|
||||
Plug 'chr4/nginx.vim'
|
||||
Plug 'Firef0x/PKGBUILD.vim'
|
||||
Plug 'elzr/vim-json', { 'for': 'json' }
|
||||
Plug 'TheEdgeOfRage/vim-pythonsense', { 'for': 'python' }
|
||||
Plug 'hashivim/vim-terraform'
|
||||
Plug 'morhetz/gruvbox'
|
||||
Plug 'mbbill/undotree'
|
||||
Plug 'iamcco/markdown-preview.nvim', { 'do': 'cd app && yarn install', 'for': ['markdown', 'vim-plug'] }
|
||||
Plug 'mboughaba/i3config.vim'
|
||||
Plug 'github/copilot.vim'
|
||||
Plug 'vim-test/vim-test'
|
||||
|
||||
endfunction
|
||||
|
||||
" Override the existing configurations and add extras here.
|
||||
function! UserConfig()
|
||||
|
||||
set termguicolors
|
||||
color gruvbox
|
||||
set encoding=utf8
|
||||
set shell=/bin/bash
|
||||
set autochdir
|
||||
set laststatus=2
|
||||
"set timeoutlen=300
|
||||
"set backspace=2
|
||||
set showcmd
|
||||
set wrap
|
||||
set linebreak
|
||||
set number
|
||||
set relativenumber
|
||||
set cursorline
|
||||
set cursorcolumn
|
||||
set tabstop=4
|
||||
set shiftwidth=4
|
||||
set softtabstop=4
|
||||
set textwidth=0
|
||||
set noexpandtab
|
||||
set autoindent
|
||||
set background=dark
|
||||
set list
|
||||
set listchars=tab:│\ ,trail:~,extends:>,precedes:<
|
||||
set splitright
|
||||
set splitbelow
|
||||
set foldmethod=indent
|
||||
|
||||
" Persistent undo
|
||||
set undofile
|
||||
set undodir=~/.local/share/nvim/undodir
|
||||
|
||||
" Backspace and Enter as G and gg
|
||||
nnoremap <CR> G
|
||||
nnoremap <BS> gg
|
||||
vnoremap <CR> G
|
||||
vnoremap <BS> gg
|
||||
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
" Colemak-Vim Mappings
|
||||
"
|
||||
" The idea is to use HNEI as arrows – keeping the traditional Vim homerow style – and changing as
|
||||
" little else as possible. This means JKL are free to use and NEI need new keys.
|
||||
" - k/K is the new n/N ["next/prev search"]
|
||||
" - l/L is the new i/I ["insert"].
|
||||
" - m/M is the new e/E ["jump" to EOW].
|
||||
" - j/J is the new m/M ["marks"]
|
||||
" - H/I skip to the beginning and end of lines. Much more intuitive than ^/$.
|
||||
" - l replaces i as the "inner" modifier [e.g. "dlw" becomes "dlw"].
|
||||
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
|
||||
|
||||
" HNEI arrows.
|
||||
noremap <silent> n j
|
||||
noremap <silent> e k
|
||||
noremap <silent> i l
|
||||
|
||||
" Merge lines
|
||||
noremap <silent> N J
|
||||
|
||||
" Last search.
|
||||
noremap k n
|
||||
noremap K N
|
||||
|
||||
" mark
|
||||
noremap j m
|
||||
noremap J M
|
||||
" l/L insert
|
||||
noremap l i
|
||||
noremap L I
|
||||
" EOW.
|
||||
noremap m e
|
||||
noremap M E
|
||||
|
||||
" End of line
|
||||
noremap I $
|
||||
noremap H ^
|
||||
|
||||
noremap <C-N> <C-E>
|
||||
noremap <C-E> <C-P>
|
||||
|
||||
" Disable default space action
|
||||
noremap <Space> <NOP>
|
||||
|
||||
" Autoindent code
|
||||
nmap <F7> jzgg=G`z
|
||||
|
||||
" Buffer actions
|
||||
nnoremap <silent> <Tab> :bn<CR>
|
||||
nnoremap <silent> <S-Tab> :bp<CR>
|
||||
nnoremap <silent> <leader>bd :bp \| bd #<cr>
|
||||
|
||||
" Unhighlight search results with \
|
||||
noremap <silent> \ :let @/ = ""<CR>
|
||||
|
||||
" Quickfix window mapping
|
||||
nnoremap <Leader>cq :cclose<CR>
|
||||
nnoremap <Leader>cn :cnext<CR>
|
||||
nnoremap <Leader>cp :cprev<CR>
|
||||
nnoremap <Leader>cf :cfirst<CR>
|
||||
nnoremap <Leader>cl :clast<CR>
|
||||
|
||||
" Window keymapping
|
||||
if !exists('g:vim_better_default_window_key_mapping') || g:vim_better_default_window_key_mapping
|
||||
nnoremap <Leader>wn <C-W>j
|
||||
nnoremap <Leader>we <C-W>k
|
||||
nnoremap <Leader>wh <C-W>h
|
||||
nnoremap <Leader>wi <C-W>l
|
||||
nnoremap <Leader>wH <C-W>5<
|
||||
nnoremap <Leader>wI <C-W>5>
|
||||
nnoremap <Leader>wN :resize +5<CR>
|
||||
nnoremap <Leader>wE :resize -5<CR>
|
||||
endif
|
||||
|
||||
" vim-test mappings
|
||||
nmap <silent> <leader>Tt :TestNearest<CR>
|
||||
nmap <silent> <leader>Tf :TestFile<CR>
|
||||
nmap <silent> <leader>Ta :TestSuite<CR>
|
||||
nmap <silent> <leader>Tl :TestLast<CR>
|
||||
nmap <silent> <leader>Tg :TestVisit<CR>
|
||||
|
||||
" FZF mappings
|
||||
noremap <C-P> :GFiles<CR>
|
||||
noremap <leader>ff :Files<CR>
|
||||
noremap <C-G> :Lines<CR>
|
||||
noremap <C-Q> :Buffers<CR>
|
||||
noremap <C-T> :Tags<CR>
|
||||
noremap <leader>? :Maps<CR>
|
||||
|
||||
" Nerdcommenter maps
|
||||
nmap <Leader>/ <Plug>NERDCommenterToggle
|
||||
vmap <Leader>/ <Plug>NERDCommenterToggle
|
||||
|
||||
" Fugitive maps
|
||||
nnoremap <silent> <Leader>gd :Gvdiff<CR>
|
||||
|
||||
" Undotree maps
|
||||
nnoremap <F3> :UndotreeToggle<cr>
|
||||
|
||||
" LSP mappings
|
||||
nnoremap gr :call spacevim#lang#util#FindReferences()<CR>
|
||||
nnoremap gi :call spacevim#lang#util#Implementation()<CR>
|
||||
nnoremap E :call spacevim#plug#coc#show_documentation()<CR>
|
||||
|
||||
" CoC mapping
|
||||
" inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<CR>"
|
||||
inoremap <silent><expr> <CR> coc#pum#visible() ? coc#pum#confirm() : "\<C-g>u\<CR>\<c-r>=coc#on_enter()\<CR>"
|
||||
inoremap <silent><expr> <C-x><C-z> coc#pum#visible() ? coc#pum#stop() : "\<C-x>\<C-z>"
|
||||
" remap for complete to use tab and <cr>
|
||||
inoremap <silent><expr> <TAB> coc#pum#visible() ? coc#pum#next(1) : "\<Tab>"
|
||||
inoremap <expr><S-TAB> coc#pum#visible() ? coc#pum#prev(1) : "\<C-h>"
|
||||
inoremap <silent><expr> <c-space> coc#refresh()
|
||||
|
||||
hi CocSearch ctermfg=12 guifg=#18A3FF
|
||||
hi CocMenuSel ctermbg=109 guibg=#13354A
|
||||
|
||||
""""""""""""""""""""""
|
||||
" Plugin configuration
|
||||
""""""""""""""""""""""
|
||||
|
||||
" Airline settings
|
||||
let g:airline_powerline_fonts = 1
|
||||
let g:airline_theme='gruvbox'
|
||||
let g:airline#extensions#ale#enabled = 1
|
||||
|
||||
" Signify settings
|
||||
let g:signify_sign_delete_first_line = '-'
|
||||
|
||||
" Per filetype indentation settings
|
||||
augroup filetypeDefinitions
|
||||
autocmd Filetype c,cpp setl noet ts=4 sts=4 sw=4
|
||||
autocmd Filetype html setl noet ts=2 sts=2 sw=2
|
||||
autocmd Filetype javascript,js setl et ts=4 sts=4 sw=4
|
||||
autocmd Filetype json,jsonnet setl et ts=4 sts=4 sw=4
|
||||
autocmd Filetype lua setl et ts=2 sts=2 sw=2
|
||||
autocmd Filetype nginx setl noet ts=4 sts=4 sw=4
|
||||
autocmd Filetype php setl et ts=4 sw=4 sts=4 tw=0
|
||||
autocmd Filetype python setl et ts=4 sw=4 sts=4 tw=0
|
||||
autocmd Filetype rst setl autoindent& cindent& smartindent& indentexpr& et ts=4 sts=4 sw=4
|
||||
autocmd Filetype terraform setl et ts=2 sts=2 sw=2
|
||||
autocmd Filetype tex setl et ts=4 sts=4 sw=4
|
||||
autocmd Filetype typescript setl et ts=2 sts=2 sw=2
|
||||
autocmd Filetype yaml,helm setl et ts=2 sts=2 sw=2
|
||||
augroup END
|
||||
|
||||
augroup filetypedetect
|
||||
autocmd BufNew,BufNewFile,BufRead *.network,*.netdev :setfiletype systemd
|
||||
autocmd BufNew,BufNewFile,BufRead *.rasi setf css
|
||||
augroup END
|
||||
|
||||
" Don't insert title into new files
|
||||
autocmd! spacevimNewFile BufNewFile *.py,*.cpp,*.c,*.sh,*.java,*.pl
|
||||
|
||||
" Format files
|
||||
command! FormatJSON %!python -m json.tool
|
||||
command! FormatPython %!yapf
|
||||
command! W :execute ':silent w !sudo tee % > /dev/null' | :edit!
|
||||
|
||||
" autocmd! spacevimStart
|
||||
|
||||
" Strip trailing whitespaces on save
|
||||
fun! <SID>StripTrailingWhitespaces()
|
||||
let l = line('.')
|
||||
let c = col('.')
|
||||
%s/\s\+$//e
|
||||
call cursor(l, c)
|
||||
endfun
|
||||
autocmd FileType * autocmd BufWritePre <buffer> :call <SID>StripTrailingWhitespaces()
|
||||
|
||||
" JSON disable quote conceal
|
||||
let g:vim_json_syntax_conceal = 0
|
||||
|
||||
" Ale settings
|
||||
let g:ale_linters = {
|
||||
\ 'c': ['gcc'],
|
||||
\ 'cpp': ['gcc'],
|
||||
\ 'javascript': ['eslint'],
|
||||
\ 'python': ['flake8', 'isort', 'mypy'],
|
||||
\ 'typescript': ['prettier', 'eslint'],
|
||||
\ 'go': ['gofmt', 'golangci-lint', 'gopls', 'govet']
|
||||
\ }
|
||||
let g:ale_fixers = {
|
||||
\ '*': ['remove_trailing_lines', 'trim_whitespace'],
|
||||
\ 'go': ['gofmt', 'goimports', 'golines'],
|
||||
\ 'terraform': ['terraform'],
|
||||
\ 'typescript': ['prettier'],
|
||||
\ }
|
||||
let g:ale_lint_on_insert_leave = 1
|
||||
let g:ale_fix_on_save = 1
|
||||
|
||||
" fzf config
|
||||
let g:fzf_colors = {
|
||||
\ 'fg': ['fg', 'GruvboxGray'],
|
||||
\ 'bg': ['bg', 'Normal'],
|
||||
\ 'hl': ['fg', 'GruvboxRed'],
|
||||
\ 'fg+': ['fg', 'GruvboxGreen'],
|
||||
\ 'bg+': ['bg', 'GruvboxBg1'],
|
||||
\ 'hl+': ['fg', 'GruvboxRed'],
|
||||
\ 'info': ['fg', 'GruvboxOrange'],
|
||||
\ 'prompt': ['fg', 'GruvboxBlue'],
|
||||
\ 'header': ['fg', 'GruvboxBlue'],
|
||||
\ 'pointer': ['fg', 'Error'],
|
||||
\ 'marker': ['fg', 'Error'],
|
||||
\ 'spinner': ['fg', 'Statement'],
|
||||
\ }
|
||||
|
||||
" NERDCommenter configuration
|
||||
let g:NERDCustomDelimiters = {
|
||||
\ 'requirements': {'left': '#'},
|
||||
\ 'systemd': {'left': '#'},
|
||||
\ 'vue': {'left': '//'},
|
||||
\ }
|
||||
let g:NERDDefaultAlign = 'left'
|
||||
|
||||
" Coc extensions
|
||||
let g:coc_global_extensions = ['coc-json', 'coc-pyright', 'coc-go', 'coc-clangd']
|
||||
endfunction
|
Loading…
Reference in New Issue