summaryrefslogtreecommitdiff
path: root/.config
diff options
context:
space:
mode:
Diffstat (limited to '.config')
-rw-r--r--.config/alacritty/alacritty.yml4
-rw-r--r--.config/nvim/init.vim50
-rw-r--r--.config/nvim/lua/binds.lua27
-rw-r--r--.config/nvim/lua/init.lua5
-rw-r--r--.config/nvim/lua/opts.lua74
-rw-r--r--.config/nvim/lua/plugins.lua46
-rw-r--r--.config/nvim/lua/setup.lua24
-rw-r--r--.config/nvim/lua/stl.lua27
-rw-r--r--.config/picom/picom.conf3
9 files changed, 212 insertions, 48 deletions
diff --git a/.config/alacritty/alacritty.yml b/.config/alacritty/alacritty.yml
index aff3c32..11dd3ef 100644
--- a/.config/alacritty/alacritty.yml
+++ b/.config/alacritty/alacritty.yml
@@ -316,8 +316,8 @@ font:
#
# Window opacity as a floating point number from `0.0` to `1.0`.
# The value `0.0` is completely transparent and `1.0` is opaque.
-#background_opacity: 1.0
-background_opacity: 0.9
+# background_opacity: 1
+
#colors:
# Default colors
# primary:
diff --git a/.config/nvim/init.vim b/.config/nvim/init.vim
index 3757748..6907a74 100644
--- a/.config/nvim/init.vim
+++ b/.config/nvim/init.vim
@@ -10,49 +10,9 @@ if has('mouse')
set mouse=a
endif
-set nocompatible
-set hidden
-set wildmenu
-set showcmd
-set hlsearch
-set ignorecase
-set smartcase
-set backspace=indent,eol,start
-set autoindent
-set nostartofline
-set ruler
-set laststatus=0
-set confirm
-set visualbell
-set t_vb=
-set cmdheight=2
-set number
-set relativenumber
-set notimeout ttimeout ttimeoutlen=200
-set pastetoggle=<F11>
-set shiftwidth=4
-set softtabstop=4
-set expandtab
-set incsearch
-
-map Y y$
-nnoremap <C-L> :nohl<CR><C-L>
-nnoremap n nzzzv
-nnoremap N Nzzzv
-
-" inoremap kj <Esc>
-inoremap , ,<c-g>u
-inoremap . .<c-g>u
-inoremap [ [<c-g>u
-inoremap ! !<c-g>u
-inoremap ? ?<c-g>u
-
-nnoremap <expr> k (v:count > 5 ? "m'" . v:count : "") . 'k'
-nnoremap <expr> j (v:count > 5 ? "m'" . v:count : "") . 'j'
-
-nnoremap <SPACE> <Nop>
-let mapleader=" "
+if has('persistent_undo')
+ set undodir=$HOME/.vim/undo
+ set undofile
+endif
-colorscheme default
-highlight CursorLineNr cterm=bold ctermfg=Yellow
-highlight LineNr ctermfg=Brown
+lua require 'init'
diff --git a/.config/nvim/lua/binds.lua b/.config/nvim/lua/binds.lua
new file mode 100644
index 0000000..5782f68
--- /dev/null
+++ b/.config/nvim/lua/binds.lua
@@ -0,0 +1,27 @@
+vim.g.mapleader = ' '
+vim.b.mapleader = ' '
+
+local map = vim.api.nvim_set_keymap
+local opts = { noremap = true, silent = true }
+
+map('', 'Y', 'y$', opts)
+map('n', '<C-L>', ':nohl<CR><C-L>', opts)
+map('n', 'n', 'nzzzv', opts)
+map('n', 'N', 'Nzzzv', opts)
+
+map('i', 'kj', '<Esc>', opts)
+map('i', ',', ',<c-g>u', opts)
+map('i', '.', '.<c-g>u', opts)
+map('i', '[', '[<c-g>u', opts)
+map('i', '!', '!<c-g>u', opts)
+map('i', '?', '?<c-g>u', opts)
+
+map('n', '<leader>fu', '<cmd>Telescope lsp_references<cr>', opts)
+map('n', '<leader>gd', '<cmd>Telescope lsp_definitions<cr>', opts)
+map('n', '<leader>rn', '<cmd>lua vim.lsp.buf.rename()<cr>', opts)
+map('n', '<leader>xd', '<cmd>Telescope lsp_document_diagnostics<cr>', opts)
+map('n', '<leader>xD', '<cmd>Telescope lsp_workspace_diagnostics<cr>', opts)
+map('n', '<leader>xn', '<cmd>lua vim.lsp.diagnostic.goto_next()<cr>', opts)
+map('n', '<leader>xN', '<cmd>lua vim.lsp.diagnostic.goto_prev()<cr>', opts)
+map('n', '<leader>xx', '<cmd>Telescope lsp_code_actions<cr>', opts)
+map('n', '<leader>xX', '<cmd>Telescope lsp_range_code_actions<cr>', opts)
diff --git a/.config/nvim/lua/init.lua b/.config/nvim/lua/init.lua
new file mode 100644
index 0000000..3bc3238
--- /dev/null
+++ b/.config/nvim/lua/init.lua
@@ -0,0 +1,5 @@
+require('plugins')
+require('opts')
+require('setup')
+require('binds')
+require('stl')
diff --git a/.config/nvim/lua/opts.lua b/.config/nvim/lua/opts.lua
new file mode 100644
index 0000000..4500929
--- /dev/null
+++ b/.config/nvim/lua/opts.lua
@@ -0,0 +1,74 @@
+-- autocomplete config
+local cmp = require 'cmp'
+
+cmp.setup {
+ mapping = {
+ ['<Tab>'] = cmp.mapping.select_next_item(),
+ ['<S-Tab>'] = cmp.mapping.select_prev_item(),
+ ['<C-e>'] = cmp.mapping.close(),
+ ['<CR>'] = cmp.mapping.confirm({
+ behavior = cmp.ConfirmBehavior.Replace,
+ select = true,
+ })
+ },
+ sources = {
+ { name = 'nvim_lsp' },
+ }
+}
+
+-- C#
+local pid = vim.fn.getpid()
+
+require 'lspconfig'.omnisharp.setup {
+ capabilities = require('cmp_nvim_lsp').update_capabilities(vim.lsp.protocol.make_client_capabilities()),
+ on_attach = function(_, bufnr)
+ vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
+ end,
+ cmd = { "/usr/bin/omnisharp", "--languageserver" , "--hostPID", tostring(pid) },
+}
+
+-- LUA
+local sumneko_root_path = "/home/adam/Documents/github/lua-language-server"
+local sumneko_binary = sumneko_root_path.."/bin/Linux/lua-language-server"
+
+local runtime_path = vim.split(package.path, ';')
+table.insert(runtime_path, "lua/?.lua")
+table.insert(runtime_path, "lua/?/init.lua")
+
+require'lspconfig'.sumneko_lua.setup {
+ cmd = {sumneko_binary, "-E", sumneko_root_path.."/main.lua"};
+ settings = {
+ Lua = {
+ runtime = {
+ -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim)
+ version = 'LuaJIT',
+ -- Setup your lua path
+ path = runtime_path,
+ },
+ 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),
+ },
+ -- Do not send telemetry data containing a randomized but unique identifier
+ telemetry = {
+ enable = false,
+ },
+ },
+ },
+}
+
+-- Treesitter
+require'nvim-treesitter.configs'.setup {
+ highlight = {
+ enable = true,
+ },
+}
+
+require'lspconfig'.html.setup{}
+require'lspconfig'.cssls.setup{}
+require'lspconfig'.tsserver.setup{}
+require'lspconfig'.bashls.setup{}
diff --git a/.config/nvim/lua/plugins.lua b/.config/nvim/lua/plugins.lua
new file mode 100644
index 0000000..49354f2
--- /dev/null
+++ b/.config/nvim/lua/plugins.lua
@@ -0,0 +1,46 @@
+return require('packer').startup(function()
+ use 'wbthomason/packer.nvim'
+ use 'gruvbox-community/gruvbox'
+
+ use 'neovim/nvim-lspconfig'
+ use 'hrsh7th/nvim-cmp'
+ use 'hrsh7th/cmp-nvim-lsp'
+ use 'hrsh7th/cmp-buffer'
+ use 'hrsh7th/cmp-path'
+
+ use 'kyazdani42/nvim-web-devicons'
+
+ use {
+ 'norcalli/nvim-colorizer.lua',
+ ft = { 'css', 'javascript', 'vim', 'html' },
+ config = [[require('colorizer').setup {'css', 'javascript', 'vim', 'html'}]],
+ }
+
+ use {
+ 'nvim-telescope/telescope.nvim',
+ requires = { {'nvim-lua/plenary.nvim'} }
+ }
+
+ use 'tpope/vim-fugitive'
+ use {
+ 'lewis6991/gitsigns.nvim',
+ requires = {
+ 'nvim-lua/plenary.nvim'
+ },
+ config = function()
+ require('gitsigns').setup()
+ end
+ }
+
+ use {
+ 'hoob3rt/lualine.nvim',
+ requires = {'kyazdani42/nvim-web-devicons', opt = true}
+ }
+
+ use {
+ 'nvim-treesitter/nvim-treesitter',
+ run = ':TSUpdate'
+ }
+
+ use 'ThePrimeagen/vim-be-good'
+end)
diff --git a/.config/nvim/lua/setup.lua b/.config/nvim/lua/setup.lua
new file mode 100644
index 0000000..9dc3698
--- /dev/null
+++ b/.config/nvim/lua/setup.lua
@@ -0,0 +1,24 @@
+local set = vim.opt
+
+set.termguicolors = true
+set.hidden = true
+set.wildmenu = true
+set.showcmd = true
+set.hlsearch = true
+set.ignorecase = true
+set.smartcase = true
+set.incsearch = true
+set.backspace= 'indent,eol,start'
+set.pastetoggle = '<F11>'
+set.confirm = true
+set.relativenumber = true
+set.shiftwidth = 4
+set.softtabstop = 4
+set.autoindent = true
+set.expandtab = true
+set.showmode = false
+set.ruler = false
+
+vim.cmd('colorscheme gruvbox')
+vim.cmd('highlight CursorLineNr cterm=bold ctermfg=Yellow ctermbg=none')
+vim.cmd('highlight Normal ctermbg=none')
diff --git a/.config/nvim/lua/stl.lua b/.config/nvim/lua/stl.lua
new file mode 100644
index 0000000..1f5f47f
--- /dev/null
+++ b/.config/nvim/lua/stl.lua
@@ -0,0 +1,27 @@
+require'lualine'.setup {
+ options = {
+ icons_enabled = true,
+ theme = 'gruvbox',
+ component_separators = {'', ''},
+ section_separators = {'', ''},
+ disabled_filetypes = {}
+ },
+ sections = {
+ lualine_a = {'mode'},
+ lualine_b = {'branch'},
+ lualine_c = {'filename'},
+ lualine_x = {'encoding', 'filetype'},
+ lualine_y = {'progress'},
+ lualine_z = {'location'}
+ },
+ inactive_sections = {
+ lualine_a = {},
+ lualine_b = {},
+ lualine_c = {'filename'},
+ lualine_x = {'location'},
+ lualine_y = {},
+ lualine_z = {}
+ },
+ tabline = {},
+ extensions = {}
+}
diff --git a/.config/picom/picom.conf b/.config/picom/picom.conf
index 496ac30..4f0d925 100644
--- a/.config/picom/picom.conf
+++ b/.config/picom/picom.conf
@@ -41,7 +41,8 @@ opacity-rule = [
"100:_NET_WM_STATE@[1]:32a = '_NET_WM_STATE_FULLSCREEN'",
"100:_NET_WM_STATE@[2]:32a = '_NET_WM_STATE_FULLSCREEN'",
"100:_NET_WM_STATE@[3]:32a = '_NET_WM_STATE_FULLSCREEN'",
- "100:_NET_WM_STATE@[4]:32a = '_NET_WM_STATE_FULLSCREEN'"
+ "100:_NET_WM_STATE@[4]:32a = '_NET_WM_STATE_FULLSCREEN'",
+ "90:class_g = 'Alacritty' && !focused"
];