Compare commits
12 Commits
8cbfecc80b
...
master
Author | SHA1 | Date | |
---|---|---|---|
b49e96fab3 | |||
25127dd0c9 | |||
0c25d5c867 | |||
10f5c07a9b | |||
c47546d65a | |||
ae88f67228 | |||
38f4d21db1 | |||
c2f6aa1b45 | |||
27fd7cc0a1 | |||
814370f187 | |||
a45fa180b3 | |||
c43b6e5704 |
2
.gitlab/merge_requests_templates/default.md
Normal file
2
.gitlab/merge_requests_templates/default.md
Normal file
@@ -0,0 +1,2 @@
|
||||
|
||||
/assign_reviewer @patrick.michl
|
13
init.lua
13
init.lua
@@ -1,7 +1,13 @@
|
||||
require 'plugins'
|
||||
|
||||
vim.g.onedark_style = 'warmer'
|
||||
require('onedark').setup()
|
||||
vim.g.loaded = 1
|
||||
vim.g.loaded_netrwPlugin = 1
|
||||
|
||||
require('onedark').setup {
|
||||
style = 'warmer'
|
||||
}
|
||||
require('onedark').load()
|
||||
vim.cmd('set background=dark')
|
||||
|
||||
require 'lsp'
|
||||
require 'completion'
|
||||
@@ -9,4 +15,5 @@ require 'treesitter'
|
||||
require 'term'
|
||||
require 'settings'
|
||||
require 'keys'
|
||||
|
||||
require("symbols-outline").setup()
|
||||
require"fidget".setup{}
|
||||
|
@@ -7,7 +7,10 @@ cmp.setup {
|
||||
require('luasnip').lsp_expand(args.body)
|
||||
end,
|
||||
},
|
||||
mapping = {
|
||||
window = {
|
||||
documentation = true
|
||||
},
|
||||
mapping = cmp.mapping.preset.insert({
|
||||
['<C-p>'] = cmp.mapping.select_prev_item(),
|
||||
['<C-n>'] = cmp.mapping.select_next_item(),
|
||||
['<C-d>'] = cmp.mapping.scroll_docs(-4),
|
||||
@@ -36,7 +39,7 @@ cmp.setup {
|
||||
fallback()
|
||||
end
|
||||
end,
|
||||
},
|
||||
}),
|
||||
sources = {
|
||||
{ name = 'nvim_lsp' },
|
||||
{ name = 'luasnip' },
|
||||
|
14
lua/keys.lua
14
lua/keys.lua
@@ -1,16 +1,16 @@
|
||||
local key = vim.api.nvim_set_keymap
|
||||
local u = require('utils')
|
||||
|
||||
vim.cmd([[autocmd bufenter * if (winnr("$") == 1 && exists("b:NERDTree") && b:NERDTree.isTabTree()) | q | endif]])
|
||||
vim.cmd([[autocmd CursorHold * lua vim.lsp.diagnostic.show_line_diagnostics({focusable = false})]])
|
||||
vim.cmd([[autocmd CursorHold * lua vim.diagnostic.open_float({focusable = false})]])
|
||||
|
||||
key('n', ';', ':Telescope find_files<CR>', {})
|
||||
key('', '<C-n>', ':NvimTreeToggle<CR>', {})
|
||||
key('n', '<C-n>', ':NvimTreeToggle<CR>', {})
|
||||
key('n', 'gh', '/<c-r>=expand("<cword>")<CR><CR>N', {})
|
||||
|
||||
key('i', '<TAB>', 'pumvisible() ? "<C-n>" : "<Tab>"', { expr = true, silent = true })
|
||||
key('i', '<S-TAB>', 'pumvisible() ? "<C-p>" : "<S-Tab>"', { expr = true, silent = true })
|
||||
key('n', '<leader>g', ':lua require"telescope.builtin".live_grep{}<CR>', {})
|
||||
key('v', '<leader>c', ':w !xclip -sel c<CR><CR>', { silent = true })
|
||||
|
||||
-- Highlight on yank
|
||||
vim.api.nvim_exec(
|
||||
@@ -23,3 +23,11 @@ vim.api.nvim_exec(
|
||||
false
|
||||
)
|
||||
|
||||
vim.api.nvim_create_autocmd("BufEnter", {
|
||||
nested = true,
|
||||
callback = function()
|
||||
if #vim.api.nvim_list_wins() == 1 and vim.api.nvim_buf_get_name(0):match("NvimTree_") ~= nil then
|
||||
vim.cmd 'quit'
|
||||
end
|
||||
end
|
||||
})
|
||||
|
18
lua/lsp.lua
18
lua/lsp.lua
@@ -1,4 +1,3 @@
|
||||
require'lspinstall'.setup()
|
||||
local u = require('utils')
|
||||
local nvim_lsp = require'lspconfig'
|
||||
|
||||
@@ -47,31 +46,32 @@ local on_attach = function(client, bufnr)
|
||||
underline = true
|
||||
}
|
||||
)
|
||||
require "lsp_signature".on_attach({doc_lines = 0})
|
||||
end
|
||||
|
||||
-- nvim-cmp supports additional completion capabilities
|
||||
local capabilities = vim.lsp.protocol.make_client_capabilities()
|
||||
capabilities = require('cmp_nvim_lsp').update_capabilities(capabilities)
|
||||
capabilities = require('cmp_nvim_lsp').default_capabilities(capabilities)
|
||||
|
||||
|
||||
local servers = require'lspinstall'.installed_servers()
|
||||
for _, lsp in ipairs(servers) do
|
||||
local servers = require'nvim-lsp-installer'
|
||||
servers.on_server_ready(function(server)
|
||||
local config = {
|
||||
on_attach = on_attach,
|
||||
capabilities = capabilities,
|
||||
flags = {debounce_text_changes = 150}
|
||||
}
|
||||
if lsp == "lua" then
|
||||
if server.name == "sumneko_lua" then
|
||||
config.settings = require'lsp.lua'
|
||||
end
|
||||
if lsp == "rust" then
|
||||
if server.name == "rust_analyzer" then
|
||||
config.settings = require'lsp.rust'
|
||||
end
|
||||
nvim_lsp[lsp].setup(config)
|
||||
end
|
||||
|
||||
server:setup(config)
|
||||
end)
|
||||
|
||||
-- Set completeopt to have a better completion experience
|
||||
vim.o.completeopt = 'menuone,noselect'
|
||||
|
||||
|
||||
|
||||
|
@@ -1,3 +1,16 @@
|
||||
local ensure_packer = function()
|
||||
local fn = vim.fn
|
||||
local install_path = fn.stdpath('data')..'/site/pack/packer/start/packer.nvim'
|
||||
if fn.empty(fn.glob(install_path)) > 0 then
|
||||
fn.system({'git', 'clone', '--depth', '1', 'https://github.com/wbthomason/packer.nvim', install_path})
|
||||
vim.cmd [[packadd packer.nvim]]
|
||||
return true
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local packer_bootstrap = ensure_packer()
|
||||
|
||||
vim.cmd([[autocmd BufWritePost plugins.lua source <afile> | PackerCompile]])
|
||||
|
||||
return require('packer').startup({function()
|
||||
@@ -32,8 +45,6 @@ return require('packer').startup({function()
|
||||
opt = true,
|
||||
cmd = { 'Dispatch', 'Dispatch!' }
|
||||
}
|
||||
use 'scrooloose/nerdtree'
|
||||
use 'Xuyuanp/nerdtree-git-plugin'
|
||||
use 'tpope/vim-fugitive'
|
||||
use 'tpope/vim-commentary'
|
||||
use 'sheerun/vim-polyglot'
|
||||
@@ -46,17 +57,18 @@ return require('packer').startup({function()
|
||||
use 'xolox/vim-misc'
|
||||
use 'airblade/vim-gitgutter'
|
||||
use 'akinsho/toggleterm.nvim'
|
||||
|
||||
-- LSP Setup
|
||||
use 'neovim/nvim-lspconfig'
|
||||
use 'kabouzeid/nvim-lspinstall'
|
||||
use 'williamboman/nvim-lsp-installer'
|
||||
use 'nvim-lua/lsp_extensions.nvim'
|
||||
use 'ray-x/lsp_signature.nvim'
|
||||
use 'nvim-lua/completion-nvim'
|
||||
use 'nvim-lua/popup.nvim'
|
||||
use {
|
||||
'nvim-telescope/telescope.nvim',
|
||||
requires = { {'nvim-lua/plenary.nvim'} }
|
||||
}
|
||||
use {'nvim-telescope/telescope-fzf-native.nvim', run = 'make' }
|
||||
use 'nvim-lua/plenary.nvim'
|
||||
use 'L3MON4D3/LuaSnip' -- Snippets plugin
|
||||
use 'hrsh7th/nvim-cmp' -- Autocompletion plugin
|
||||
@@ -66,9 +78,13 @@ return require('packer').startup({function()
|
||||
use "hrsh7th/cmp-path"
|
||||
use 'kdheepak/cmp-latex-symbols'
|
||||
use 'nvim-treesitter/nvim-treesitter'
|
||||
use 'simrat39/symbols-outline.nvim'
|
||||
use 'j-hui/fidget.nvim'
|
||||
|
||||
use 'kyazdani42/nvim-web-devicons'
|
||||
|
||||
use 'stevearc/dressing.nvim'
|
||||
|
||||
use {
|
||||
'kyazdani42/nvim-tree.lua',
|
||||
cmd = {
|
||||
@@ -78,6 +94,11 @@ return require('packer').startup({function()
|
||||
},
|
||||
config = function() require'plugins/nvim-tree' end
|
||||
}
|
||||
use 'justinmk/vim-sneak'
|
||||
|
||||
if packer_bootstrap then
|
||||
require('packer').sync()
|
||||
end
|
||||
end,
|
||||
config = {
|
||||
display = {
|
||||
|
@@ -7,6 +7,7 @@ cmd('syntax on')
|
||||
cmd('set number')
|
||||
cmd('set completeopt=menuone,noinsert,noselect')
|
||||
cmd('set shortmess+=c')
|
||||
cmd("autocmd CursorHold,CursorHoldI *.rs :lua require'lsp_extensions'.inlay_hints{ only_current_line = true }")
|
||||
|
||||
o.startofline = true
|
||||
wo.cursorline = true
|
||||
|
Reference in New Issue
Block a user