Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
vim/.netrwhist
vim/spell

nvim/plugin
4 changes: 1 addition & 3 deletions gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
branch = auto
ui = auto
[core]
editor = vim
editor = nvim
attributesfile = ~/.gitattributes
excludesfile = ~/.gitignore
filemode = false
Expand All @@ -24,8 +24,6 @@
command = ~/bin/git-imgdiff
[push]
default = simple
[credential]
helper = libsecret
[pager]
diff = diff-highlight | less
show = diff-highlight | less
Expand Down
11 changes: 11 additions & 0 deletions install-nerdfonts.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
mkdir -p ~/.fonts
cd ~/.fonts
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.0/RobotoMono.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.0/Inconsolata.zip
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.0/FiraCode.zip

unzip -o RobotoMono.zip
unzip -o Inconsolata.zip
unzip -o FiraCode.zip

sudo fc-cache -vf ~/.fonts
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ $(create-alias zshrc ~/.zshrc)
$(create-alias tmux.conf ~/.tmux.conf)
$(create-alias gitconfig ~/.gitconfig)
$(create-alias gitignore ~/.gitignore)
$(create-alias nvim ~/.config/nvim)
$(create-alias vscode-settings.json ~/.config/Code/User/settings.json)
$(create-alias vscode-keybindings.json ~/.config/Code/User/keybindings.json)
$(create-alias vscode-snippets ~/.config/Code/User/snippets)
1 change: 1 addition & 0 deletions nvim/after/plugin/colorscheme.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
vim.cmd([[colorscheme gruvbox]])
43 changes: 43 additions & 0 deletions nvim/after/plugin/lsp.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
local lsp = require('lsp-zero').preset({
})

lsp.on_attach(function(client, bufnr)
lsp.default_keymaps({buffer = bufnr})
end)

lsp.setup_servers({
'tsserver',
'eslint',
})

-- Configure lua language server for neovim
require('lspconfig').lua_ls.setup(lsp.nvim_lua_ls())


lsp.setup()

local cmp = require('cmp')
local cmp_action = require('lsp-zero').cmp_action()
local cmp_select_opts = {behavior = cmp.SelectBehavior.Select}


cmp.setup({
mapping = {
-- `Enter` key to confirm completion
['<CR>'] = cmp.mapping.confirm({select = false}),

-- Navigate between completions
['<C-p>'] = cmp.mapping.select_prev_item(cmp_select_opts),
['<C-n>'] = cmp.mapping.select_next_item(cmp_select_opts),

['<Tab>'] = cmp_action.tab_complete(),
['<S-Tab>'] = cmp_action.select_prev_or_fallback(),

-- Ctrl+Space to trigger completion menu
['<C-Space>'] = cmp.mapping.complete(),

-- Navigate between snippet placeholder
['<C-f>'] = cmp_action.luasnip_jump_forward(),
['<C-b>'] = cmp_action.luasnip_jump_backward(),
}
})
14 changes: 14 additions & 0 deletions nvim/after/plugin/lualine.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require('lualine').setup {
options = {
icons_enabled = true,
theme = 'dracula',
},
sections = {
lualine_a = {
{
'filename',
path = 1,
}
}
}
}
16 changes: 16 additions & 0 deletions nvim/after/plugin/null-ls.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
local null_ls = require("null-ls")

local formatting = null_ls.builtins.formatting
local diagnostics = null_ls.builtins.diagnostics
local completion = null_ls.builtins.completion

null_ls.setup({
sources = {
formatting.stylua,
formatting.prettier,
diagnostics.eslint,
completion.spell,
},
})

vim.keymap.set('n', '<leader>k', function() vim.lsp.buf.format() end)
1 change: 1 addition & 0 deletions nvim/after/plugin/nvim-comment.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
require('nvim_comment').setup()
11 changes: 11 additions & 0 deletions nvim/after/plugin/nvim-tree.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Disable netrw (standard vim file manager)
vim.g.loaded_netrw = 1
vim.g.loaded_netrwPlugin = 1

require("nvim-tree").setup({
view = {
adaptive_size = true
}
})

vim.keymap.set('n', '<c-b>', ':NvimTreeFindFileToggle<CR>')
6 changes: 6 additions & 0 deletions nvim/after/plugin/telescope.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
local builtin = require('telescope.builtin')
vim.keymap.set('n', '<leader>p', builtin.find_files, {})
vim.keymap.set('n', '<C-p>', builtin.git_files, {})
vim.keymap.set('n', '<leader>f', function()
builtin.grep_string({ search = vim.fn.input("Grep > ") });
end)
21 changes: 21 additions & 0 deletions nvim/after/plugin/treesitter.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
require'nvim-treesitter.configs'.setup {
-- A list of parser names, or "all" (the five listed parsers should always be installed)
ensure_installed = { "c", "lua", "vim", "vimdoc", "query", "javascript", "typescript" },

-- Install parsers synchronously (only applied to `ensure_installed`)
sync_install = false,

-- Automatically install missing parsers when entering buffer
-- Recommendation: set to false if you don't have `tree-sitter` CLI installed locally
auto_install = true,

highlight = {
enable = true,

-- Setting this to true will run `:h syntax` and tree-sitter at the same time.
-- Set this to `true` if you depend on 'syntax' being enabled (like for indentation).
-- Using this option may slow down your editor, and you may see some duplicate highlights.
-- Instead of true it can also be a list of languages
additional_vim_regex_highlighting = false,
},
}
3 changes: 3 additions & 0 deletions nvim/init.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
require("core.keymaps")
require("core.plugins")
require("core.set")
2 changes: 2 additions & 0 deletions nvim/lua/core/keymaps.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vim.g.mapleader = 'ö'
vim.g.maplocalleader = 'ö'
61 changes: 61 additions & 0 deletions nvim/lua/core/plugins.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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()

return require('packer').startup(function(use)
use 'wbthomason/packer.nvim'
use 'ellisonleao/gruvbox.nvim'
use 'nvim-tree/nvim-tree.lua'
use 'nvim-tree/nvim-web-devicons'
use 'nvim-lualine/lualine.nvim'
use {
'nvim-telescope/telescope.nvim', tag = '0.1.1',
requires = { {'nvim-lua/plenary.nvim'} }
}
use('nvim-treesitter/nvim-treesitter', { run = ':TSUpdate' })
use('terrortylor/nvim-comment')
use({
"kylechui/nvim-surround",
tag = "*", -- Use for stability; omit to use `main` branch for the latest features
config = function()
require("nvim-surround").setup({})
end,
requires = { "nvim-lua/plenary.nvim" },
})
use {
'VonHeikemen/lsp-zero.nvim',
branch = 'v2.x',
requires = {
-- LSP Support
{'neovim/nvim-lspconfig'}, -- Required
{ -- Optional
'williamboman/mason.nvim',
run = function()
pcall(vim.cmd, 'MasonUpdate')
end,
},
{'williamboman/mason-lspconfig.nvim'}, -- Optional

-- Autocompletion
{'hrsh7th/nvim-cmp'}, -- Required
{'hrsh7th/cmp-nvim-lsp'}, -- Required
{'L3MON4D3/LuaSnip'}, -- Required
}
}
use 'jose-elias-alvarez/null-ls.nvim'

-- Automatically set up your configuration after cloning packer.nvim
-- Put this at the end after all plugins
if packer_bootstrap then
require('packer').sync()
end
end)
25 changes: 25 additions & 0 deletions nvim/lua/core/set.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
vim.opt.number = true -- show line numbers

vim.opt.tabstop = 2 -- a tab is two spaces
vim.opt.softtabstop = 2 -- a tab is two spaces in insert
vim.opt.shiftwidth = 2 -- an autoindent (with <<) is two spaces
vim.opt.expandtab = true -- use spaces, not tabs
vim.opt.smartindent = true -- use smart autoindent

vim.opt.wrap = false -- don't wrap lines

vim.opt.swapfile = false -- don't use a swapfile
vim.opt.backup = false -- don't use a backup
vim.opt.undofile = true -- use an undo file instead

vim.opt.ignorecase = true -- ignore casing in searches
vim.opt.smartcase = true -- enable casing in searches if there is an upper case letter in the search

vim.opt.list = true -- show invisible characters (tabs and trailing spaces)

vim.opt.termguicolors = true -- enables 24-bit RGB colors

vim.opt.scrolloff = 4 -- always show 4 lines above and below
vim.opt.sidescrolloff = 4 -- always show 4 columns left and right

vim.opt.autowrite = true -- write when buffers are changed
1 change: 1 addition & 0 deletions nvim/stylua.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
indent_type = "Spaces"
2 changes: 1 addition & 1 deletion zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ alias grb="git rebase"
alias gdc="git diff --cached"
alias gst="git stash"
alias git-remote-cleanup="git remote prune origin"
alias gbam="git branch --merged master | grep -v master | xargs git branch -d"
alias gbam="echo 'Use gbda from oh my zsh git plugin instead'"
alias gpn="git push --no-verify"

alias sagi="sudo apt-get install"
Expand Down