Skip to content

Commit

Permalink
Added some lsp clients and changed to catppuccin theme
Browse files Browse the repository at this point in the history
  • Loading branch information
JannoTjarks committed Oct 20, 2022
1 parent cf263a5 commit fb1c526
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 67 deletions.
23 changes: 23 additions & 0 deletions .config/nvim/after/plugin/catppuccin.rc.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
vim.g.catppuccin_flavour = "macchiato" -- latte, frappe, macchiato, mocha
require("catppuccin").setup({
integrations = {
barbar = true,
cmp = true,
gitsigns = true,
nvimtree = true,
telescope = true,
treesitter = true,
which_key = true,

-- Special integrations, see https://github.com/catppuccin/nvim#special-integrations
indent_blankline = {
enabled = true,
colored_indent_levels = false,
},
native_lsp = {
enabled = true,
},
},
})

vim.api.nvim_command "colorscheme catppuccin"
56 changes: 39 additions & 17 deletions .config/nvim/after/plugin/lspconfig.rc.vim
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ if !exists('g:lspconfig')
endif

lua <<EOF
local nvim_lsp = require('lspconfig')
local protocol = require('vim.lsp.protocol')

local on_attach = function(client, bufnr)
local function buf_set_keymap(...) vim.api.nvim_buf_set_keymap(bufnr, ...) end
local function buf_set_option(...) vim.api.nvim_buf_set_option(bufnr, ...) end
Expand Down Expand Up @@ -39,38 +36,63 @@ local on_attach = function(client, bufnr)
end
end

local capabilities = require('cmp_nvim_lsp').default_capabilities

local signs = { Error = "", Warn = "", Hint = "", Info = "" }
for type, icon in pairs(signs) do
local hl = "DiagnosticSign" .. type
vim.fn.sign_define(hl, { text = icon, texthl = hl, numhl = hl })
end

nvim_lsp.tsserver.setup {
on_attach = on_attach
require('lspconfig').tsserver.setup {
on_attach = on_attach,
capabilities = capabilities
}

require'lspconfig'.eslint.setup {
on_attach = on_attach,
capabilities = capabilities
}

require('lspconfig').jsonls.setup{
on_attach = on_attach,
capabilities = capabilities
}

nvim_lsp.terraformls.setup {
require('lspconfig').yamlls.setup{
on_attach = on_attach,
capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()),
capabilities = capabilities
}

nvim_lsp.gopls.setup {
on_attach = on_attach
require('lspconfig').terraformls.setup {
on_attach = on_attach,
capabilities = capabilities
}

nvim_lsp.yamlls.setup {
on_attach = on_attach
require('lspconfig').gopls.setup {
on_attach = on_attach,
capabilities = capabilities
}

nvim_lsp.jsonls.setup {
on_attach = on_attach
require('lspconfig').bashls.setup{
on_attach = on_attach,
capabilities = capabilities
}

nvim_lsp.bashls.setup {
on_attach = on_attach
require('lspconfig').powershell_es.setup{
bundle_path = '~/powershell-editor-services',
on_attach = on_attach,
default_capabilities
}

nvim_lsp.ccls.setup{
on_attach = on_attach
require'lspconfig'.omnisharp.setup {
cmd = { "dotnet", "/home/janno/bin/omnisharp/OmniSharp.dll" },
on_attach = on_attach,
capabilities = capabilities
}

require'lspconfig'.jedi_language_server.setup{
on_attach = on_attach,
capabilities = capabilities
}
EOF
46 changes: 37 additions & 9 deletions .config/nvim/after/plugin/lualine.rc.lua
Original file line number Diff line number Diff line change
@@ -1,25 +1,53 @@
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'dracula',
theme = "catppuccin",
component_separators = { left = '', right = ''},
section_separators = { left = '', right = ''},
disabled_filetypes = {},
always_divide_middle = true,
},
sections = {
lualine_a = {'mode'},
lualine_b = {'branch', 'diff', { 'diagnostics', sources = {"nvim_diagnostic"}, symbols = {error = '', warn = '', info = '', hint = ''} } },
lualine_c = {'filename'},
lualine_x = {'encoding', 'fileformat', 'filetype'},
lualine_y = {'progress'},
lualine_z = {'location'}
lualine_a = {
'mode'
},
lualine_b = {
'branch',
'diff',
{
'diagnostics',
sources = {
"nvim_diagnostic"
},
symbols = {
error = '', warn = '', info = '', hint = ''}
}
},
lualine_c = {
'filename'
},
lualine_x = {
'encoding',
'fileformat',
'filetype'
},
lualine_y = {
'searchcount',
'progress'
},
lualine_z = {
'location'
}
},
inactive_sections = {
lualine_a = {},
lualine_b = {},
lualine_c = {'filename'},
lualine_x = {'location'},
lualine_c = {
'filename'
},
lualine_x = {
'location'
},
lualine_y = {},
lualine_z = {}
},
Expand Down
7 changes: 6 additions & 1 deletion .config/nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ set backupdir=~/.vim/backups

" Accessablity
set shortmess+=c
set signcolumn=yes
set showmode
set signcolumn=yes
set ruler
set number
set autoread
Expand All @@ -17,6 +17,7 @@ set conceallevel=3
set concealcursor-=n
set clipboard^=unnamed,unnamedplus


" Search
set incsearch
set hlsearch
Expand All @@ -41,4 +42,8 @@ nnoremap <right> <nop>
if has("nvim")
lua require('plugins')
set termguicolors

" Disable search and mode because its shown in the lualine
set shortmess+=S
set noshowmode
endif
15 changes: 2 additions & 13 deletions .config/nvim/lua/plugins.lua
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ return require('packer').startup(function()
}

-- File management/fuzzy finding
-- use 'scrooloose/nerdtree'
use {
'kyazdani42/nvim-tree.lua',
requires = { 'kyazdani42/nvim-web-devicons', opt = true }
Expand All @@ -47,22 +46,12 @@ return require('packer').startup(function()

-- colorscheme
use {
'tomasiser/vim-code-dark',
config = function()
vim.cmd("colorscheme codedark")
end,
}
use {
'dracula/vim',
config = function()
vim.cmd("colorscheme dracula")
end,
'catppuccin/nvim',
as = "catppuccin"
}

-- Shortcuts
use 'preservim/nerdcommenter'
use "folke/which-key.nvim"


end)

96 changes: 69 additions & 27 deletions .config/nvim/plugin/packer_compiled.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,26 @@ vim.api.nvim_command('packadd packer.nvim')

local no_errors, error_msg = pcall(function()

local time
local profile_info
local should_profile = false
if should_profile then
local hrtime = vim.loop.hrtime
profile_info = {}
time = function(chunk, start)
if start then
profile_info[chunk] = hrtime()
else
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
end
_G._packer = _G._packer or {}
_G._packer.inside_compile = true

local time
local profile_info
local should_profile = false
if should_profile then
local hrtime = vim.loop.hrtime
profile_info = {}
time = function(chunk, start)
if start then
profile_info[chunk] = hrtime()
else
profile_info[chunk] = (hrtime() - profile_info[chunk]) / 1e6
end
else
time = function(chunk, start) end
end

else
time = function(chunk, start) end
end

local function save_profiles(threshold)
local sorted_times = {}
for chunk_name, time_taken in pairs(profile_info) do
Expand All @@ -38,8 +41,10 @@ local function save_profiles(threshold)
results[i] = elem[1] .. ' took ' .. elem[2] .. 'ms'
end
end
if threshold then
table.insert(results, '(Only showing plugins that took longer than ' .. threshold .. ' ms ' .. 'to load)')
end

_G._packer = _G._packer or {}
_G._packer.profile_output = results
end

Expand Down Expand Up @@ -79,6 +84,11 @@ _G.packer_plugins = {
path = "/home/janno/.local/share/nvim/site/pack/packer/start/barbar.nvim",
url = "https://github.com/romgrk/barbar.nvim"
},
catppuccin = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/catppuccin",
url = "https://github.com/catppuccin/nvim"
},
["cmp-buffer"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/cmp-buffer",
Expand All @@ -89,11 +99,31 @@ _G.packer_plugins = {
path = "/home/janno/.local/share/nvim/site/pack/packer/start/cmp-nvim-lsp",
url = "https://github.com/hrsh7th/cmp-nvim-lsp"
},
["cmp-path"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/cmp-path",
url = "https://github.com/hrsh7th/cmp-path"
},
["diffview.nvim"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/diffview.nvim",
url = "https://github.com/sindrets/diffview.nvim"
},
["editorconfig.nvim"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/editorconfig.nvim",
url = "https://github.com/gpanders/editorconfig.nvim"
},
["gitsigns.nvim"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/gitsigns.nvim",
url = "https://github.com/lewis6991/gitsigns.nvim"
},
["indent-blankline.nvim"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/indent-blankline.nvim",
url = "https://github.com/lukas-reineke/indent-blankline.nvim"
},
["lspkind.nvim"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/lspkind.nvim",
Expand All @@ -109,11 +139,6 @@ _G.packer_plugins = {
path = "/home/janno/.local/share/nvim/site/pack/packer/start/nerdcommenter",
url = "https://github.com/preservim/nerdcommenter"
},
nerdtree = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/nerdtree",
url = "https://github.com/scrooloose/nerdtree"
},
["nvim-cmp"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/nvim-cmp",
Expand All @@ -124,6 +149,11 @@ _G.packer_plugins = {
path = "/home/janno/.local/share/nvim/site/pack/packer/start/nvim-lspconfig",
url = "https://github.com/neovim/nvim-lspconfig"
},
["nvim-tree.lua"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/nvim-tree.lua",
url = "https://github.com/kyazdani42/nvim-tree.lua"
},
["nvim-treesitter"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/nvim-treesitter",
Expand Down Expand Up @@ -154,19 +184,31 @@ _G.packer_plugins = {
path = "/home/janno/.local/share/nvim/site/pack/packer/start/telescope.nvim",
url = "https://github.com/nvim-telescope/telescope.nvim"
},
vim = {
["true-zen.nvim"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/vim",
url = "https://github.com/dracula/vim"
path = "/home/janno/.local/share/nvim/site/pack/packer/start/true-zen.nvim",
url = "https://github.com/Pocco81/true-zen.nvim"
},
["vim-terraform"] = {
["twilight.nvim"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/vim-terraform",
url = "https://github.com/hashivim/vim-terraform"
path = "/home/janno/.local/share/nvim/site/pack/packer/start/twilight.nvim",
url = "https://github.com/folke/twilight.nvim"
},
["which-key.nvim"] = {
loaded = true,
path = "/home/janno/.local/share/nvim/site/pack/packer/start/which-key.nvim",
url = "https://github.com/folke/which-key.nvim"
}
}

time([[Defining packer_plugins]], false)

_G._packer.inside_compile = false
if _G._packer.needs_bufread == true then
vim.cmd("doautocmd BufRead")
end
_G._packer.needs_bufread = false

if should_profile then save_profiles() end

end)
Expand Down

0 comments on commit fb1c526

Please sign in to comment.