Skip to content

Commit

Permalink
split up vscode vs native config, add octo
Browse files Browse the repository at this point in the history
  • Loading branch information
dlants committed Aug 4, 2023
1 parent ea901ab commit 52845d7
Show file tree
Hide file tree
Showing 13 changed files with 443 additions and 251 deletions.
1 change: 1 addition & 0 deletions init.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#! /bin/bash
ln -sf ~/src/dotfiles/tmux.conf ~/.tmux.conf
ln -sf ~/src/dotfiles/zshrc ~/.zshrc
ln -sf ~/src/dotfiles/digrc ~/.digrc
ln -sf ~/src/dotfiles/zpreztorc ~/.zpreztorc
ln -sf ~/src/dotfiles/nvim/init.lua ~/.config/nvim/init.lua
ln -sf ~/src/dotfiles/nvim/lua ~/.config/nvim/lua
Expand Down
81 changes: 5 additions & 76 deletions nvim/init.lua
Original file line number Diff line number Diff line change
@@ -1,76 +1,5 @@
require "plugins"

vim.cmd "colorscheme OceanicNext"
vim.cmd "filetype plugin indent on"

vim.g.mapleader = " "
vim.g.maplocalleader = "\\"

vim.o.background = "dark"
vim.o.number = true
vim.o.clipboard = "unnamedplus"
vim.o.tabstop = 2
vim.o.shiftwidth = 2
vim.o.softtabstop = 0
vim.o.expandtab = true
vim.o.shell = "/opt/homebrew/bin/zsh"

vim.o.ignorecase = true
vim.o.smartcase = true
vim.o.incsearch = true
vim.o.hlsearch = true

vim.wo.wrap = false
vim.wo.cursorline = true
vim.wo.cursorcolumn = true
vim.wo.colorcolumn = "120"

vim.cmd "autocmd BufWritePre * StripWhitespace"

-- replace unimpaired bindings
vim.api.nvim_set_keymap("n", "[j", "<C-O>", {noremap = true})
vim.api.nvim_set_keymap("n", "]j", "<C-I>", {noremap = true})
vim.api.nvim_set_keymap("n", "[q", ":cp<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "]q", ":cn<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "[l", ":lp<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "]l", ":lne<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "[<space>", "O<Esc>j", {noremap = true})
vim.api.nvim_set_keymap("n", "]<space>", "o<Esc>k", {noremap = true})
vim.api.nvim_set_keymap("n", "[f", ":colder<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "]f", ":cnewer<CR>", {noremap = true})


vim.api.nvim_set_keymap("n", "<leader>=", ":resize +5<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "<leader>-", ":resize -5<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "<leader>+", ":vertical resize +5<CR>", {noremap = true})
vim.api.nvim_set_keymap("n", "<leader>_", ":vertical resize -5<CR>", {noremap = true})

require "config/hop"
require "config/lsp"
require "config/completion-and-snippets"
require "config/lualine"
require "config/formatter"
require "config/treesitter"
require "config/harpoon"
-- require "config/trouble"
-- require "config/lua-dev"
-- not ready to use telescope yet... seems a bit clunky compared to fzf
require "config/telescope"

-- fzf
-- vim.cmd "set rtp+=/opt/homebrew/opt/fzf"
-- vim.cmd "let g:fzf_layout = {'up': '~50%'}"
-- vim.api.nvim_set_keymap("n", "<leader>p", ":GFiles<CR>", {noremap = true, silent = true})
-- vim.api.nvim_set_keymap("n", "<leader>o", ":Files<CR>", {noremap = true, silent = true})

-- grepper
vim.cmd "runtime plugin/grepper.vim"
vim.cmd "let g:grepper.prompt_quote = 0"
vim.cmd "let g:grepper.tools = ['rg']"
-- vim.cmd "let g:grepper.rg.grepprg .= ' --hidden'"
vim.api.nvim_set_keymap("n", "<leader>g", ":Grepper<CR>", {noremap = true, silent = true})

vim.cmd "augroup lsp"
vim.cmd " au!"
vim.cmd " au FileType java lua print('hello'); require('config/lsp').start_jdt()"
vim.cmd "augroup end"
if vim.g.vscode then
require "./init-vscode"
else
require "./init-native"
end
19 changes: 19 additions & 0 deletions nvim/lua/config/formatter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ require "formatter".setup {
}
end
},
yaml = {
function()
return {
exe = "npx prettier",
args = {"--stdin-filepath", vim.api.nvim_buf_get_name(0)},
stdin = true
}
end
},
html = {
function()
return {
Expand All @@ -71,6 +80,7 @@ require "formatter".setup {
},
lua = {
-- luafmt
-- npm install -g lua-fmt
function()
return {
exe = "luafmt",
Expand All @@ -97,6 +107,15 @@ require "formatter".setup {
stdin = true
}
end
},
terraform = {
function()
return {
exe = "terraform",
args = {"fmt", "-"},
stdin = true
}
end
}
}
}
Expand Down
Loading

0 comments on commit 52845d7

Please sign in to comment.