Compare commits
26 Commits
161cc068a2
...
master
Author | SHA1 | Date | |
---|---|---|---|
|
15d27dc96a | ||
e777391307 | |||
|
9f6b6776c2 | ||
|
8c82f7cab4 | ||
|
4da8e11ada | ||
|
ac2447ac6e | ||
|
fd5401c9d7 | ||
|
1d2cd23307 | ||
|
40303719a2 | ||
|
b2f02b5c13 | ||
|
afcce108f7 | ||
|
46edb66356 | ||
|
cc9fc11a62 | ||
|
a4e6919899 | ||
4fc013a680 | |||
|
aa72c826c0 | ||
|
717c7f09e5 | ||
|
6a51019731 | ||
|
7cffe20d81 | ||
|
966adc7817 | ||
|
fe9da6af57 | ||
|
a8818ea92a | ||
|
bebd4c1ff9 | ||
|
aa4d71c989 | ||
|
c1516e7018 | ||
|
54181f1123 |
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
spell/
|
19
.luarc.json
Normal file
19
.luarc.json
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"workspace.library": [
|
||||||
|
"/Users/fschmidt/.config/nvim",
|
||||||
|
"/Users/fschmidt/.local/share/nvim/lazy/lazy.nvim",
|
||||||
|
"/Users/fschmidt/.local/share/nvim/lazy/cmp-nvim-lsp",
|
||||||
|
"/Users/fschmidt/.local/share/nvim/lazy/nvim-lspconfig",
|
||||||
|
"/Users/fschmidt/.local/share/nvim/lazy/mason.nvim",
|
||||||
|
"/Users/fschmidt/.local/share/nvim/lazy/mason-lspconfig.nvim",
|
||||||
|
"/Users/fschmidt/.local/share/nvim/lazy/nvim-web-devicons",
|
||||||
|
"/Users/fschmidt/.local/share/nvim/lazy/nvim-tree.lua",
|
||||||
|
"/Users/fschmidt/.local/share/nvim/lazy/null-ls.nvim",
|
||||||
|
"/Users/fschmidt/.local/share/nvim/lazy/lualine.nvim",
|
||||||
|
"/usr/local/Cellar/neovim/0.8.3/share/nvim/runtime",
|
||||||
|
"/usr/local/Cellar/neovim/0.8.3/lib/nvim",
|
||||||
|
"/Users/fschmidt/.local/state/nvim/lazy/readme",
|
||||||
|
"/Users/fschmidt/.local/share/nvim/lazy/cmp-nvim-lsp/after",
|
||||||
|
"${3rd}/luassert/library"
|
||||||
|
]
|
||||||
|
}
|
48
init.lua
48
init.lua
@@ -1,7 +1,45 @@
|
|||||||
-- init.lua
|
-- init.lua
|
||||||
|
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)
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
require("lazy").setup("plugins")
|
||||||
|
require("maps").init()
|
||||||
|
require("commands")
|
||||||
|
|
||||||
require('lua/plugins')
|
vim.opt.backup = false
|
||||||
require('lua/settings')
|
vim.opt.undodir = os.getenv("HOME") .. '/.cache/nvim/undodir'
|
||||||
require('lua/maps')
|
vim.opt.swapfile = false
|
||||||
require('lua/commands')
|
vim.opt.undofile = true
|
||||||
require('lua/utils')
|
vim.opt.smartcase = true
|
||||||
|
vim.opt.ignorecase = true
|
||||||
|
vim.opt.laststatus = 2
|
||||||
|
vim.opt.hidden = true
|
||||||
|
vim.opt.hlsearch = false
|
||||||
|
vim.opt.incsearch = true
|
||||||
|
vim.opt.scrolloff = 12
|
||||||
|
vim.opt.sidescrolloff = 8
|
||||||
|
vim.opt.mouse = 'a'
|
||||||
|
vim.opt.autochdir = true
|
||||||
|
vim.opt.clipboard = 'unnamed,unnamedplus'
|
||||||
|
vim.opt.number = true
|
||||||
|
vim.opt.wrap = false
|
||||||
|
vim.opt.signcolumn = 'yes:2'
|
||||||
|
vim.opt.list = true
|
||||||
|
vim.opt.listchars = 'tab:▸ ,trail:·'
|
||||||
|
vim.opt.shiftwidth = 4
|
||||||
|
vim.opt.tabstop = 4
|
||||||
|
vim.opt.softtabstop = 4
|
||||||
|
vim.opt.expandtab = false
|
||||||
|
vim.opt.autoindent = true
|
||||||
|
vim.opt.smartindent = true
|
||||||
|
vim.opt.completeopt = { "menu", "menuone", "noselect" }
|
||||||
|
37
lazy-lock.json
Normal file
37
lazy-lock.json
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
{
|
||||||
|
"LuaSnip": { "branch": "master", "commit": "03c8e67eb7293c404845b3982db895d59c0d1538" },
|
||||||
|
"bufferline.nvim": { "branch": "main", "commit": "5c528bee3dd797d5bd6bae5f229411939b25b203" },
|
||||||
|
"cmp-buffer": { "branch": "main", "commit": "3022dbc9166796b644a841a02de8dd1cc1d311fa" },
|
||||||
|
"cmp-cmdline": { "branch": "main", "commit": "d250c63aa13ead745e3a40f61fdd3470efde3923" },
|
||||||
|
"cmp-nvim-lsp": { "branch": "main", "commit": "39e2eda76828d88b773cc27a3f61d2ad782c922d" },
|
||||||
|
"cmp-nvim-lsp-signature-help": { "branch": "main", "commit": "031e6ba70b0ad5eee49fd2120ff7a2e325b17fa7" },
|
||||||
|
"cmp-nvim-lua": { "branch": "main", "commit": "f12408bdb54c39c23e67cab726264c10db33ada8" },
|
||||||
|
"cmp-path": { "branch": "main", "commit": "91ff86cd9c29299a64f968ebb45846c485725f23" },
|
||||||
|
"cmp_luasnip": { "branch": "master", "commit": "05a9ab28b53f71d1aece421ef32fee2cb857a843" },
|
||||||
|
"dashboard-nvim": { "branch": "master", "commit": "d2c5a4d1341f5ca1ed2ecb4ecfcff2bc8ea18b14" },
|
||||||
|
"fidget.nvim": { "branch": "main", "commit": "e2a175c2abe2d4f65357da1c98c59a5cfb2b543f" },
|
||||||
|
"gitsigns.nvim": { "branch": "main", "commit": "7c27a30450130cd59c4994a6755e3c5d74d83e76" },
|
||||||
|
"kanagawa.nvim": { "branch": "master", "commit": "f491b0fe68fffbece7030181073dfe51f45cda81" },
|
||||||
|
"lazy.nvim": { "branch": "main", "commit": "cf8ecc2c5e4332760431a33534240b0cbc6680ab" },
|
||||||
|
"lspkind-nvim": { "branch": "master", "commit": "a700f1436d4a938b1a1a93c9962dc796afbaef4d" },
|
||||||
|
"lualine.nvim": { "branch": "master", "commit": "b431d228b7bbcdaea818bdc3e25b8cdbe861f056" },
|
||||||
|
"lunar.nvim": { "branch": "master", "commit": "08bbc93b96ad698d22fc2aa01805786bcedc34b9" },
|
||||||
|
"mason-lspconfig.nvim": { "branch": "main", "commit": "4d0e5b49363cac187326998b96aa6a2884e0e89b" },
|
||||||
|
"mason.nvim": { "branch": "main", "commit": "e2f7f9044ec30067bc11800a9e266664b88cda22" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "ee297f215e95a60b01fde33275cc3c820eddeebe" },
|
||||||
|
"nvim-cmp": { "branch": "main", "commit": "29fb4854573355792df9e156cb779f0d31308796" },
|
||||||
|
"nvim-dap": { "branch": "master", "commit": "7ff6936010b7222fea2caea0f67ed77f1b7c60dd" },
|
||||||
|
"nvim-dap-ui": { "branch": "master", "commit": "ffa89839f97bad360e78428d5c740fdad9a0ff02" },
|
||||||
|
"nvim-dap-virtual-text": { "branch": "master", "commit": "52638640ae309cacdaff785fdbb854437bd1ee5c" },
|
||||||
|
"nvim-lspconfig": { "branch": "master", "commit": "54617a18f4cf46f0c2f6d024fa6feb7515fe036d" },
|
||||||
|
"nvim-nio": { "branch": "master", "commit": "a428f309119086dc78dd4b19306d2d67be884eee" },
|
||||||
|
"nvim-tree.lua": { "branch": "master", "commit": "120ba58254835d412bbc91cffe847e9be835fadd" },
|
||||||
|
"nvim-treesitter": { "branch": "master", "commit": "f9e9370a6f710148f4a3f3f4f23d5349c85c2888" },
|
||||||
|
"nvim-web-devicons": { "branch": "master", "commit": "19d257cf889f79f4022163c3fbb5e08639077bd8" },
|
||||||
|
"playground": { "branch": "master", "commit": "ba48c6a62a280eefb7c85725b0915e021a1a0749" },
|
||||||
|
"plenary.nvim": { "branch": "master", "commit": "2d9b06177a975543726ce5c73fca176cedbffe9d" },
|
||||||
|
"rustaceanvim": { "branch": "master", "commit": "bc8c4b8f7606d5b7c067cd8369e25c1a7ff77bd0" },
|
||||||
|
"telescope.nvim": { "branch": "master", "commit": "a0bbec21143c7bc5f8bb02e0005fa0b982edc026" },
|
||||||
|
"trouble.nvim": { "branch": "main", "commit": "2f3b537f2207ce32f4459f9d56746ee013b5e01b" },
|
||||||
|
"vimwiki": { "branch": "dev", "commit": "72792615e739d0eb54a9c8f7e0a46a6e2407c9e8" }
|
||||||
|
}
|
@@ -1,10 +1,12 @@
|
|||||||
-- commands.lua
|
-- commands.lua
|
||||||
|
|
||||||
-- autocmd! User GoyoEnter Limelight
|
|
||||||
-- autocmd! User GoyoLeave Limelight!
|
|
||||||
-- command W :execute ':silent w !sudo tee % > /dev/null' | :edit!
|
|
||||||
|
|
||||||
vim.cmd 'autocmd! User GoyoEnter Limelight'
|
vim.cmd 'autocmd! User GoyoEnter Limelight'
|
||||||
vim.cmd 'autocmd! User GoyoLeave Limelight!'
|
vim.cmd 'autocmd! User GoyoLeave Limelight!'
|
||||||
|
|
||||||
|
vim.cmd 'autocmd BufRead,BufNewFile *.wiki,*.md,*.tex set wrap'
|
||||||
|
|
||||||
|
vim.cmd 'au BufRead,BufNewFile *.kdl set filetype=kdl'
|
||||||
|
|
||||||
|
vim.cmd [[autocmd BufWritePre * lua vim.lsp.buf.format()]]
|
||||||
|
|
||||||
vim.cmd 'command W :execute \':silent w !sudo tee % > /dev/null\' | :edit!'
|
vim.cmd 'command W :execute \':silent w !sudo tee % > /dev/null\' | :edit!'
|
||||||
|
66
lua/maps.lua
66
lua/maps.lua
@@ -1,29 +1,59 @@
|
|||||||
-- maps.lua
|
-- maps.lua
|
||||||
|
|
||||||
|
local maps = {}
|
||||||
|
|
||||||
local function map(mode, lhs, rhs, opts)
|
local function map(mode, lhs, rhs, opts)
|
||||||
local options = { noremap = true }
|
local options = { noremap = true }
|
||||||
if opts then options = vim.tbl_extend('force', options, opts) end
|
if opts then options = vim.tbl_extend('force', options, opts) end
|
||||||
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
vim.api.nvim_set_keymap(mode, lhs, rhs, options)
|
||||||
end
|
end
|
||||||
|
|
||||||
vim.g.mapleader = ","
|
function maps.toggleGoyo()
|
||||||
-- Toggle Goyo
|
|
||||||
map('n', '<C-g>', ':Goyo<Enter>', { noremap = false })
|
map('n', '<C-g>', ':Goyo<Enter>', { noremap = false })
|
||||||
|
end
|
||||||
|
|
||||||
|
function maps.term()
|
||||||
-- Open and move to resized terminal
|
-- Open and move to resized terminal
|
||||||
map('n', '<leader>t', '<C-w>s<C-w>j :terminal<CR>:res 5<CR>i', { noremap = false })
|
map('n', '<leader>t', '<C-w>s<C-w>j :terminal<CR>:res 5<CR>i', { noremap = false })
|
||||||
-- Enter normal mode in terminal
|
-- Enter normal mode in terminal
|
||||||
map('t', '¿<C-N>', '<C-\\><C-N>')
|
map('t', 'ß<C-N>', '<C-\\><C-N>')
|
||||||
-- Clear highlight
|
end
|
||||||
map('n', '<C-l>', '<cmd>noh<CR>')
|
|
||||||
-- Move to window in any mode
|
function maps.telescope()
|
||||||
-- map('t', 'ª', '<C-\\><C-N><C-w>h')
|
map('n', '<Leader>ff', '<cmd>lua require(\'telescope.builtin\').git_files()<CR>')
|
||||||
-- map('t', 'º', '<C-\\><C-N><C-w>j')
|
map('n', '<Leader>fg', '<cmd>lua require(\'telescope.builtin\').live_grep()<CR>')
|
||||||
-- map('t', '∆', '<C-\\><C-N><C-w>k')
|
map('n', '<Leader>fb', '<cmd>lua require(\'telescope.builtin\').buffers()<CR>')
|
||||||
-- map('t', '@', '<C-\\><C-N><C-w>l')
|
map('n', '<Leader>fh', '<cmd>lua require(\'telescope.builtin\').help_tags()<CR>')
|
||||||
-- map('i', 'ª', '<C-\\><C-N><C-w>h')
|
end
|
||||||
-- map('i', 'º', '<C-\\><C-N><C-w>j')
|
|
||||||
-- map('i', '∆', '<C-\\><C-N><C-w>k')
|
function maps.fixIndent()
|
||||||
-- map('i', '@', '<C-\\><C-N><C-w>l')
|
map('v', '<', '<gv')
|
||||||
-- map('n', 'ª', '<C-w>h')
|
map('v', '>', '>gv')
|
||||||
-- map('n', 'º', '<C-w>j')
|
end
|
||||||
-- map('n', '∆', '<C-w>k')
|
|
||||||
-- map('n', '@', '<C-w>l')
|
function maps.moveByRow()
|
||||||
|
-- When text is wrapped, move by terminal rows, not lines, unles a count is provided
|
||||||
|
map('n', 'j', 'v:count == 0 ? \'gj\' : \'j\'', { silent = true, expr = true })
|
||||||
|
map('n', 'k', 'v:count == 0 ? \'gk\' : \'k\'', { silent = true, expr = true })
|
||||||
|
end
|
||||||
|
|
||||||
|
function maps.centeredSearch()
|
||||||
|
map('n', 'n', 'nzzzv')
|
||||||
|
map('n', 'N', 'Nzzzv')
|
||||||
|
end
|
||||||
|
|
||||||
|
function maps.init()
|
||||||
|
vim.g.mapleader = " "
|
||||||
|
|
||||||
|
map('n', '<leader>b', '<cmd>NvimTreeToggle<CR>')
|
||||||
|
map('n', '<leader>cc', '<cmd>Telescope colorscheme<CR>')
|
||||||
|
|
||||||
|
maps.toggleGoyo()
|
||||||
|
maps.term()
|
||||||
|
maps.telescope()
|
||||||
|
maps.fixIndent()
|
||||||
|
maps.moveByRow()
|
||||||
|
maps.centeredSearch()
|
||||||
|
end
|
||||||
|
|
||||||
|
return maps
|
||||||
|
@@ -1,18 +0,0 @@
|
|||||||
-- plugin.lua
|
|
||||||
|
|
||||||
vim.cmd 'packadd paq-nvim'
|
|
||||||
local paq = require'paq-nvim'.paq
|
|
||||||
paq{'savq/paq-nvim', opt=true}
|
|
||||||
|
|
||||||
-- Theme
|
|
||||||
paq 'akinsho/nvim-bufferline.lua'
|
|
||||||
paq 'hoob3rt/lualine.nvim'
|
|
||||||
paq 'airblade/vim-gitgutter'
|
|
||||||
paq 'kyazdani42/nvim-web-devicons'
|
|
||||||
paq 'doums/darcula'
|
|
||||||
paq 'junegunn/goyo.vim'
|
|
||||||
paq 'junegunn/limelight.vim'
|
|
||||||
|
|
||||||
-- lsp
|
|
||||||
paq 'neovim/nvim-lspconfig'
|
|
||||||
paq 'nvim-lua/completion-nvim'
|
|
17
lua/plugins/dap.lua
Normal file
17
lua/plugins/dap.lua
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'mfussenegger/nvim-dap',
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'rcarriga/nvim-dap-ui',
|
||||||
|
config = function()
|
||||||
|
require("dapui").setup()
|
||||||
|
end,
|
||||||
|
dependencies = { 'mfussenegger/nvim-dap', 'nvim-neotest/nvim-nio' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'theHamsta/nvim-dap-virtual-text',
|
||||||
|
config = true
|
||||||
|
}
|
||||||
|
}
|
261
lua/plugins/lsp.lua
Normal file
261
lua/plugins/lsp.lua
Normal file
@@ -0,0 +1,261 @@
|
|||||||
|
local opts = { noremap = true, silent = true }
|
||||||
|
vim.keymap.set('n', '<space>e', vim.diagnostic.open_float, opts)
|
||||||
|
vim.keymap.set('n', ',d', vim.diagnostic.goto_prev, opts)
|
||||||
|
vim.keymap.set('n', '.d', vim.diagnostic.goto_next, opts)
|
||||||
|
|
||||||
|
local lsp_attach = function(client, buf)
|
||||||
|
vim.api.nvim_buf_set_option(buf, "formatexpr", "v:lua.vim.lsp.formatexpr()")
|
||||||
|
vim.api.nvim_buf_set_option(buf, "omnifunc", "v:lua.vim.lsp.omnifunc")
|
||||||
|
vim.api.nvim_buf_set_option(buf, "tagfunc", "v:lua.vim.lsp.tagfunc")
|
||||||
|
|
||||||
|
vim.lsp.inlay_hint.enable(buf, true)
|
||||||
|
|
||||||
|
local bufopts = { noremap = true, silent = true, buffer = buf }
|
||||||
|
vim.keymap.set('n', 'gD', vim.lsp.buf.declaration, bufopts)
|
||||||
|
vim.keymap.set('n', 'gd', vim.lsp.buf.definition, bufopts)
|
||||||
|
vim.keymap.set('n', 'K', vim.lsp.buf.hover, bufopts)
|
||||||
|
vim.keymap.set('n', 'gi', vim.lsp.buf.implementation, bufopts)
|
||||||
|
vim.keymap.set('n', '<C-k>', vim.lsp.buf.signature_help, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>D', vim.lsp.buf.type_definition, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>rn', vim.lsp.buf.rename, bufopts)
|
||||||
|
vim.keymap.set('n', '<space>ca', vim.lsp.buf.code_action, bufopts)
|
||||||
|
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
||||||
|
end
|
||||||
|
|
||||||
|
local mason_path = vim.fn.glob(vim.fn.stdpath "data" .. "/mason/packages/codelldb/extension/")
|
||||||
|
local codelldb_path = mason_path .. "adapter/codelldb"
|
||||||
|
local liblldb_path = mason_path .. "lldb/lib/liblldb.so"
|
||||||
|
|
||||||
|
if vim.fn.has "mac" == 1 then
|
||||||
|
liblldb_path = mason_path .. "lldb/lib/liblldb.dylib"
|
||||||
|
end
|
||||||
|
|
||||||
|
return {
|
||||||
|
-- lsp
|
||||||
|
{
|
||||||
|
'williamboman/mason.nvim',
|
||||||
|
config = true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'williamboman/mason-lspconfig.nvim',
|
||||||
|
config = true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'neovim/nvim-lspconfig',
|
||||||
|
config = function()
|
||||||
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
local lspconfig = require('lspconfig')
|
||||||
|
|
||||||
|
lspconfig.lua_ls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
root_dir = lspconfig.util.root_pattern('.git'),
|
||||||
|
settings = {
|
||||||
|
Lua = {
|
||||||
|
runtime = {
|
||||||
|
-- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
|
||||||
|
version = 'LuaJIT',
|
||||||
|
},
|
||||||
|
diagnostics = {
|
||||||
|
-- Get the language server to recognize the `vim` global
|
||||||
|
globals = { 'vim' }
|
||||||
|
},
|
||||||
|
workspace = {
|
||||||
|
-- Make the server aware of Neovim runtime files
|
||||||
|
library = vim.api.nvim_get_runtime_file("", true),
|
||||||
|
checkThirdParty = false,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
},
|
||||||
|
on_attach = lsp_attach
|
||||||
|
}
|
||||||
|
lspconfig.ts_ls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp_attach
|
||||||
|
}
|
||||||
|
lspconfig.gopls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp_attach
|
||||||
|
}
|
||||||
|
--lspconfig.rust_analyzer.setup {
|
||||||
|
-- capabilities = capabilities,
|
||||||
|
-- on_attach = lsp_attach
|
||||||
|
--}
|
||||||
|
lspconfig.bashls.setup {
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp_attach
|
||||||
|
}
|
||||||
|
lspconfig.sqlls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp_attach
|
||||||
|
})
|
||||||
|
lspconfig.html.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp_attach
|
||||||
|
})
|
||||||
|
lspconfig.cssls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp_attach
|
||||||
|
})
|
||||||
|
lspconfig.tailwindcss.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp_attach
|
||||||
|
})
|
||||||
|
lspconfig.phpactor.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp_attach
|
||||||
|
})
|
||||||
|
capabilities.textDocument.completion.completionItem.snippetSupport = true
|
||||||
|
lspconfig.emmet_ls.setup({
|
||||||
|
capabilities = capabilities,
|
||||||
|
on_attach = lsp_attach
|
||||||
|
})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'mrcjkb/rustaceanvim',
|
||||||
|
version = "^3",
|
||||||
|
ft = { "rust" },
|
||||||
|
config = function()
|
||||||
|
vim.g.rustaceanvim = {
|
||||||
|
server = {
|
||||||
|
on_attach = lsp_attach,
|
||||||
|
settings = {
|
||||||
|
-- rust-analyzer language server configuration
|
||||||
|
["rust-analyzer"] = {
|
||||||
|
rustfmt = {
|
||||||
|
extraArgs = { "+nightly" },
|
||||||
|
},
|
||||||
|
cargo = {
|
||||||
|
allFeatures = true,
|
||||||
|
loadOutDirsFromCheck = true,
|
||||||
|
runBuildScripts = true,
|
||||||
|
},
|
||||||
|
-- Add clippy lints for Rust.
|
||||||
|
checkOnSave = {
|
||||||
|
allFeatures = true,
|
||||||
|
command = "clippy",
|
||||||
|
extraArgs = { "--no-deps" },
|
||||||
|
},
|
||||||
|
-- TODO this breaks diagnostics, look into what can be done
|
||||||
|
-- procMacro = {
|
||||||
|
-- enable = true,
|
||||||
|
-- ignored = {
|
||||||
|
-- ["async-trait"] = { "async_trait" },
|
||||||
|
-- ["napi-derive"] = { "napi" },
|
||||||
|
-- ["async-recursion"] = { "async_recursion" },
|
||||||
|
-- },
|
||||||
|
-- },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{ 'onsails/lspkind-nvim' }, -- pictograms replace (?) with lspsaga
|
||||||
|
{
|
||||||
|
'j-hui/fidget.nvim',
|
||||||
|
config = true
|
||||||
|
}, -- show lsp status
|
||||||
|
-- completion
|
||||||
|
{
|
||||||
|
'hrsh7th/nvim-cmp',
|
||||||
|
config = function()
|
||||||
|
local cmp = require('cmp')
|
||||||
|
local lspkind = require('lspkind')
|
||||||
|
|
||||||
|
vim.opt.shortmess:append 'c'
|
||||||
|
|
||||||
|
cmp.setup({
|
||||||
|
snippet = {
|
||||||
|
expand = function(args)
|
||||||
|
require('luasnip').lsp_expand(args.body)
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
mapping = cmp.mapping.preset.insert({
|
||||||
|
["<C-n>"] = cmp.mapping.select_next_item { behavior = cmp.SelectBehavior.Insert },
|
||||||
|
["<C-p>"] = cmp.mapping.select_prev_item { behavior = cmp.SelectBehavior.Insert },
|
||||||
|
['<C-b>'] = cmp.mapping(cmp.mapping.scroll_docs(-4), { 'i', 'c' }),
|
||||||
|
['<C-f>'] = cmp.mapping(cmp.mapping.scroll_docs(4), { 'i', 'c' }),
|
||||||
|
['<C-s>'] = cmp.mapping(cmp.mapping.complete(), { 'i', 'c' }),
|
||||||
|
['<C-y>'] = cmp.mapping.confirm({
|
||||||
|
behavior = cmp.ConfirmBehavior.Insert,
|
||||||
|
select = true
|
||||||
|
}),
|
||||||
|
['<C-e>'] = cmp.mapping({
|
||||||
|
i = cmp.mapping.abort(),
|
||||||
|
c = cmp.mapping.close(),
|
||||||
|
}),
|
||||||
|
['<CR>'] = cmp.mapping.confirm({ select = true }),
|
||||||
|
}),
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'nvim_lua' },
|
||||||
|
{ name = 'nvim_lsp' },
|
||||||
|
{ name = 'path' },
|
||||||
|
{ name = 'luasnip' },
|
||||||
|
{ name = 'nvim_lsp_signature_help' },
|
||||||
|
}, {
|
||||||
|
{ name = 'buffer', keyword_length = 5 },
|
||||||
|
}),
|
||||||
|
formatting = {
|
||||||
|
format = lspkind.cmp_format {
|
||||||
|
with_text = true,
|
||||||
|
menu = {
|
||||||
|
buffer = "[buf]",
|
||||||
|
nvim_lsp = "[LSP]",
|
||||||
|
nvim_lua = "[api]",
|
||||||
|
path = "[path]",
|
||||||
|
luasnip = "[snip]",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use buffer source for `/` (basically search words in buffer)
|
||||||
|
cmp.setup.cmdline('/', {
|
||||||
|
sources = {
|
||||||
|
{ name = 'buffer' }
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Use cmdline & path source for ':'
|
||||||
|
cmp.setup.cmdline(':', {
|
||||||
|
sources = cmp.config.sources({
|
||||||
|
{ name = 'path' }
|
||||||
|
}, {
|
||||||
|
{ name = 'cmdline' }
|
||||||
|
})
|
||||||
|
})
|
||||||
|
end,
|
||||||
|
event = 'InsertEnter',
|
||||||
|
dependencies = {
|
||||||
|
'hrsh7th/cmp-nvim-lsp',
|
||||||
|
'hrsh7th/cmp-nvim-lsp-signature-help',
|
||||||
|
'hrsh7th/cmp-buffer',
|
||||||
|
'hrsh7th/cmp-path',
|
||||||
|
'hrsh7th/cmp-nvim-lua',
|
||||||
|
'hrsh7th/cmp-cmdline',
|
||||||
|
'saadparwaiz1/cmp_luasnip',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'L3MON4D3/LuaSnip',
|
||||||
|
version = "v2.*",
|
||||||
|
build = "make install_jsregexp",
|
||||||
|
config = function()
|
||||||
|
require("luasnip.loaders.from_lua").load({ paths = "~/.config/nvim/snippets/" })
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'windwp/nvim-autopairs',
|
||||||
|
config = true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"folke/trouble.nvim",
|
||||||
|
dependencies = { "nvim-tree/nvim-web-devicons" },
|
||||||
|
opts = {
|
||||||
|
-- your configuration comes here
|
||||||
|
-- or leave it empty to use the default settings
|
||||||
|
-- refer to the configuration section below
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
19
lua/plugins/navigation.lua
Normal file
19
lua/plugins/navigation.lua
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'nvim-telescope/telescope.nvim',
|
||||||
|
version = '0.1.*',
|
||||||
|
dependencies = { 'nvim-lua/plenary.nvim' },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'nvim-tree/nvim-tree.lua',
|
||||||
|
config = function()
|
||||||
|
require('nvim-tree').setup {
|
||||||
|
view = {
|
||||||
|
width = 30,
|
||||||
|
side = 'left',
|
||||||
|
},
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
||||||
|
}
|
||||||
|
}
|
55
lua/plugins/style.lua
Normal file
55
lua/plugins/style.lua
Normal file
@@ -0,0 +1,55 @@
|
|||||||
|
return {
|
||||||
|
{
|
||||||
|
'rebelot/kanagawa.nvim',
|
||||||
|
config = function()
|
||||||
|
vim.opt.guifont = 'Source Code Pro for Powerline'
|
||||||
|
vim.cmd('colorscheme kanagawa')
|
||||||
|
vim.cmd('set termguicolors')
|
||||||
|
vim.opt.syntax = 'on'
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{ 'lunarvim/lunar.nvim' },
|
||||||
|
{
|
||||||
|
'nvim-treesitter/nvim-treesitter',
|
||||||
|
build = ':TSUpdate',
|
||||||
|
config = function()
|
||||||
|
require('nvim-treesitter.configs').setup {
|
||||||
|
highlight = {
|
||||||
|
enable = true,
|
||||||
|
additional_vim_regex_highlighting = false,
|
||||||
|
},
|
||||||
|
indent = {
|
||||||
|
enable = true,
|
||||||
|
disable = { "html" }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end,
|
||||||
|
dependencies = { 'nvim-treesitter/playground' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'akinsho/bufferline.nvim',
|
||||||
|
version = "*",
|
||||||
|
config = true,
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'hoob3rt/lualine.nvim',
|
||||||
|
config = function()
|
||||||
|
require('lualine').setup {
|
||||||
|
options = {
|
||||||
|
theme = 'kanagawa'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
end
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'lewis6991/gitsigns.nvim',
|
||||||
|
config = true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'glepnir/dashboard-nvim',
|
||||||
|
event = 'VimEnter',
|
||||||
|
config = true,
|
||||||
|
dependencies = { 'nvim-tree/nvim-web-devicons' }
|
||||||
|
},
|
||||||
|
}
|
12
lua/plugins/writing.lua
Normal file
12
lua/plugins/writing.lua
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
return {
|
||||||
|
-- writing
|
||||||
|
{
|
||||||
|
'vimwiki/vimwiki',
|
||||||
|
ft = { 'md', 'wiki', 'tex' },
|
||||||
|
config = function()
|
||||||
|
vim.g.vimwiki_list = { { path = '~/Documents/Buch/wiki', syntax = 'markdown', ext = '.md' } }
|
||||||
|
end
|
||||||
|
},
|
||||||
|
--{ 'junegunn/goyo.vim' }, -- try replacing these 2 at some point because they don't work that well anymore
|
||||||
|
--{ 'junegunn/limelight.vim' },
|
||||||
|
}
|
@@ -1,54 +0,0 @@
|
|||||||
-- settings.lua
|
|
||||||
|
|
||||||
local cmd = vim.cmd
|
|
||||||
local scopes = {o = vim.o, bo = vim.bo, wo = vim.wo}
|
|
||||||
|
|
||||||
local function opt(scope, key, value)
|
|
||||||
scopes[scope][key] = value
|
|
||||||
if scope ~= 'o' then scopes['o'][key] = value end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
---- Misc Options
|
|
||||||
-- global options
|
|
||||||
opt('o', 'swapfile', true)
|
|
||||||
opt('o', 'dir', '/tmp')
|
|
||||||
opt('o', 'smartcase', true)
|
|
||||||
opt('o', 'laststatus', 2)
|
|
||||||
opt('o', 'hlsearch', true)
|
|
||||||
opt('o', 'incsearch', true)
|
|
||||||
opt('o', 'ignorecase', true)
|
|
||||||
opt('o', 'scrolloff', 12)
|
|
||||||
opt('o', 'mouse', 'a')
|
|
||||||
|
|
||||||
-- window-local options
|
|
||||||
opt('wo', 'number', true)
|
|
||||||
opt('wo', 'wrap', false)
|
|
||||||
|
|
||||||
-- buffer-local options
|
|
||||||
opt('bo', 'shiftwidth', 4)
|
|
||||||
opt('bo', 'tabstop', 4)
|
|
||||||
opt('bo', 'softtabstop', 4)
|
|
||||||
opt('bo', 'expandtab', true)
|
|
||||||
opt('bo', 'autoindent', true)
|
|
||||||
|
|
||||||
---- Theme
|
|
||||||
-- Font
|
|
||||||
opt('o', 'guifont', 'Source Code Pro for Powerline')
|
|
||||||
|
|
||||||
-- Statusline
|
|
||||||
local lualine = require('lualine')
|
|
||||||
lualine.status()
|
|
||||||
|
|
||||||
-- Bufferline
|
|
||||||
local bufferline = require('bufferline')
|
|
||||||
bufferline.setup()
|
|
||||||
|
|
||||||
local function ColorDarcula()
|
|
||||||
lualine.options.theme = 'onedark'
|
|
||||||
vim.g.limelight_conceal_ctermfg = 'gray'
|
|
||||||
cmd 'colorscheme darcula'
|
|
||||||
end
|
|
||||||
|
|
||||||
opt('bo', 'syntax', 'on')
|
|
||||||
ColorDarcula()
|
|
25
snippets/go.lua
Normal file
25
snippets/go.lua
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
local ls = require("luasnip")
|
||||||
|
local s = ls.s
|
||||||
|
local i = ls.i
|
||||||
|
local t = ls.t
|
||||||
|
|
||||||
|
local d = ls.dynamic_node
|
||||||
|
local c = ls.choice_node
|
||||||
|
local f = ls.function_node
|
||||||
|
local sn = ls.snippet_node
|
||||||
|
|
||||||
|
local fmt = require("luasnip.extras.fmt").fmt
|
||||||
|
local rep = require("luasnip.extras").rep
|
||||||
|
|
||||||
|
local snippets, autosnippets = {}, {}
|
||||||
|
|
||||||
|
local errorSnippet = s("error", fmt([[
|
||||||
|
if err != nil {{
|
||||||
|
{}
|
||||||
|
}}
|
||||||
|
]], {
|
||||||
|
i(1, "return nil, err")
|
||||||
|
}))
|
||||||
|
table.insert(snippets, errorSnippet)
|
||||||
|
|
||||||
|
return snippets, autosnippets
|
Reference in New Issue
Block a user