Skip to content

Commit 39328b7

Browse files
authored
Merge pull request nvim-lua#7 from zwergius/lunarvim
Lunarvim
2 parents ddb7ca0 + 0cbdb2c commit 39328b7

File tree

6 files changed

+287
-5
lines changed

6 files changed

+287
-5
lines changed

Brewfile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ tap 'homebrew/cask-drivers'
1212

1313
#Formulaes to be installed
1414
brew 'mas'
15-
brew 'vim'
15+
brew 'neovim'
1616
brew 'node'
1717
brew 'cmake'
1818
brew 'ripgrep'
@@ -23,6 +23,7 @@ brew 'nss'
2323
2424
brew 'git'
2525
brew 'starship'
26+
brew 'warp'
2627
#
2728
# # Remove outdated versions from the cellar
2829
# cleanup
@@ -33,6 +34,7 @@ mas 'Pages', id: 409201541
3334
mas 'Tweetbot', id: 557168941
3435
mas 'Numbers', id: 409203825
3536
mas 'Xcode', id: 497799835
37+
mas 'Consent-O-Matic', id: 1606897889
3638
# swiftlint depends on xcode to be installed
3739
brew 'swiftlint'
3840

@@ -41,20 +43,27 @@ cask 'firefox'
4143
cask 'google-chrome'
4244
cask 'brave-browser'
4345
cask 'opera'
46+
cask 'sizzy'
4447

4548
cask 'discord'
46-
cask 'skype'
49+
#cask 'skype'
4750
cask 'signal'
4851
cask 'zoom'
4952

5053
cask 'rectangle'
5154
cask 'choosy'
5255
cask 'protonmail-bridge'
5356
cask 'spotify'
54-
cask 'megasync'
57+
cask 'netnewswire'
58+
#cask 'megasync'
5559
cask 'zsa-wally'
5660
cask 'graphiql'
57-
cask 'gpg-suite'
61+
#cask 'gpg-suite'
62+
cask 'affinity-designer'
63+
cask 'affinity-photo'
64+
cask 'affinity-publisher'
65+
cask 'visual-studio-code'
66+
cask 'epic-games'
5867

5968
cask 'lulu'
6069
cask 'knockknock'

gitconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@
7575
trustExitCode = true
7676
[push]
7777
default = simple
78+
autoSetupRemote = true
7879
[core]
7980
excludesfile = ~/.gitignore
8081
pager = diff-so-fancy | less --tabs=4 -RFX

lvim/config.lua

Lines changed: 232 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,232 @@
1+
--[[
2+
lvim is the global options object
3+
4+
Linters should be
5+
filled in as strings with either
6+
a global executable or a path to
7+
an executable
8+
]]
9+
-- THESE ARE EXAMPLE CONFIGS FEEL FREE TO CHANGE TO WHATEVER YOU WANT
10+
11+
-- general
12+
lvim.log.level = "warn"
13+
lvim.format_on_save = true
14+
vim.g.material_style = "deep ocean"
15+
lvim.colorscheme = "material"
16+
17+
-- keymappings [view all the defaults by pressing <leader>Lk]
18+
lvim.leader = "space"
19+
-- add your own keymapping
20+
lvim.keys.normal_mode["<C-s>"] = ":update<cr>"
21+
lvim.keys.insert_mode["<C-s>"] = "<Esc>:update<cr>"
22+
-- unmap a default keymapping
23+
lvim.keys.normal_mode["<S-l>"] = false
24+
lvim.keys.normal_mode["<S-h>"] = false
25+
-- lvim.keys.normal_mode["<C-Up>"] = false
26+
-- edit a default keymapping
27+
-- lvim.keys.normal_mode["<C-q>"] = ":q<cr>"
28+
29+
-- Change Telescope navigation to use j and k for navigation and n and p for history in both input and normal mode.
30+
-- we use protected-mode (pcall) just in case the plugin wasn't loaded yet.
31+
local _, actions = pcall(require, "telescope.actions")
32+
lvim.builtin.telescope.defaults.mappings = {
33+
-- for input mode
34+
i = {
35+
["<C-j>"] = actions.move_selection_next,
36+
["<C-k>"] = actions.move_selection_previous,
37+
["<C-n>"] = actions.cycle_history_next,
38+
["<C-p>"] = actions.cycle_history_prev,
39+
},
40+
-- for normal mode
41+
n = {
42+
["<C-j>"] = actions.move_selection_next,
43+
["<C-k>"] = actions.move_selection_previous,
44+
},
45+
}
46+
47+
-- Use which-key to add extra bindings with the leader-key prefix
48+
-- lvim.builtin.which_key.mappings["P"] = { "<cmd>Telescope projects<CR>", "Projects" }
49+
-- lvim.builtin.which_key.mappings["t"] = {
50+
-- name = "+Trouble",
51+
-- r = { "<cmd>Trouble lsp_references<cr>", "References" },
52+
-- f = { "<cmd>Trouble lsp_definitions<cr>", "Definitions" },
53+
-- d = { "<cmd>Trouble document_diagnostics<cr>", "Diagnostics" },
54+
-- q = { "<cmd>Trouble quickfix<cr>", "QuickFix" },
55+
-- l = { "<cmd>Trouble loclist<cr>", "LocationList" },
56+
-- w = { "<cmd>Trouble workspace_diagnostics<cr>", "Wordspace Diagnostics" },
57+
-- }
58+
59+
-- TODO: User Config for predefined plugins
60+
-- After changing plugin config exit and reopen LunarVim, Run :PackerInstall :PackerCompile
61+
lvim.builtin.alpha.active = true
62+
lvim.builtin.alpha.mode = "dashboard"
63+
lvim.builtin.terminal.active = true
64+
lvim.builtin.nvimtree.setup.view.side = "left"
65+
lvim.builtin.nvimtree.setup.renderer.icons.show.git = false
66+
67+
-- if you don't want all the parsers change this to a table of the ones you want
68+
lvim.builtin.treesitter.ensure_installed = {
69+
"bash",
70+
"c",
71+
"javascript",
72+
"json",
73+
"lua",
74+
"python",
75+
"typescript",
76+
"tsx",
77+
"css",
78+
"rust",
79+
"java",
80+
"yaml",
81+
"svelte",
82+
}
83+
84+
lvim.builtin.treesitter.ignore_install = { "haskell" }
85+
lvim.builtin.treesitter.highlight.enabled = true
86+
87+
-- generic LSP settings
88+
89+
-- ---@usage disable automatic installation of servers
90+
-- lvim.lsp.automatic_servers_installation = false
91+
92+
-- ---configure a server manually. !!Requires `:LvimCacheReset` to take effect!!
93+
-- ---see the full default list `:lua print(vim.inspect(lvim.lsp.automatic_configuration.skipped_servers))`
94+
-- vim.list_extend(lvim.lsp.automatic_configuration.skipped_servers, { "pyright" })
95+
-- local opts = {} -- check the lspconfig documentation for a list of all possible options
96+
-- require("lvim.lsp.manager").setup("pyright", opts)
97+
98+
-- ---remove a server from the skipped list, e.g. eslint, or emmet_ls. !!Requires `:LvimCacheReset` to take effect!!
99+
-- ---`:LvimInfo` lists which server(s) are skiipped for the current filetype
100+
-- vim.tbl_map(function(server)
101+
-- return server ~= "emmet_ls"
102+
-- end, lvim.lsp.automatic_configuration.skipped_servers)
103+
104+
-- -- you can set a custom on_attach function that will be used for all the language servers
105+
-- -- See <https://github.com/neovim/nvim-lspconfig#keybindings-and-completion>
106+
-- lvim.lsp.on_attach_callback = function(client, bufnr)
107+
-- local function buf_set_option(...)
108+
-- vim.api.nvim_buf_set_option(bufnr, ...)
109+
-- end
110+
-- --Enable completion triggered by <c-x><c-o>
111+
-- buf_set_option("omnifunc", "v:lua.vim.lsp.omnifunc")
112+
-- end
113+
114+
-- set a formatter, this will override the language server formatting capabilities (if it exists)
115+
local formatters = require "lvim.lsp.null-ls.formatters"
116+
formatters.setup {
117+
-- { command = "black", filetypes = { "python" } },
118+
-- { command = "isort", filetypes = { "python" } },
119+
-- {
120+
-- command = "eslint_d",
121+
-- filetypes = {
122+
-- "javascript",
123+
-- "typescript",
124+
-- "typescriptreact",
125+
-- "javascriptreact",
126+
-- "svelte",
127+
-- "vue",
128+
-- }
129+
-- },
130+
{
131+
-- each formatter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
132+
command = "prettierd",
133+
---@usage arguments to pass to the formatter
134+
-- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
135+
-- extra_args = { "--print-with", "100" },
136+
---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
137+
filetypes = {
138+
"javascript",
139+
"typescript",
140+
"typescriptreact",
141+
"javascriptreact",
142+
"svelte",
143+
"vue",
144+
"html",
145+
"css",
146+
"markdown",
147+
}
148+
},
149+
}
150+
151+
-- -- set additional linters
152+
local linters = require "lvim.lsp.null-ls.linters"
153+
linters.setup {
154+
{
155+
command = "eslint_d",
156+
filetypes = {
157+
"javascript",
158+
"typescript",
159+
"typescriptreact",
160+
"javascriptreact",
161+
"svelte",
162+
"vue",
163+
}
164+
},
165+
-- {
166+
-- -- each linter accepts a list of options identical to https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/doc/BUILTINS.md#Configuration
167+
-- command = "shellcheck",
168+
-- ---@usage arguments to pass to the formatter
169+
-- -- these cannot contain whitespaces, options such as `--line-width 80` become either `{'--line-width', '80'}` or `{'--line-width=80'}`
170+
-- extra_args = { "--severity", "warning" },
171+
-- },
172+
-- {
173+
-- command = "codespell",
174+
-- ---@usage specify which filetypes to enable. By default a providers will attach to all the filetypes it supports.
175+
-- filetypes = { "javascript", "python" },
176+
-- },
177+
}
178+
179+
-- Additional Plugins
180+
lvim.plugins = {
181+
{ "sainnhe/sonokai" },
182+
{ "marko-cerovac/material.nvim" },
183+
{ "Shatur/neovim-ayu" },
184+
-- {
185+
-- "aca/emmet-ls",
186+
-- config = function()
187+
-- local lspconfig = require("lspconfig")
188+
-- local configs = require("lspconfig/configs")
189+
--
190+
-- local capabilities = vim.lsp.protocol.make_client_capabilities()
191+
-- capabilities.textDocument.completion.completionItem.snippetSupport = true
192+
-- -- capabilities.textDocument.completion.completionItem.resolveSupport = {
193+
-- -- properties = {
194+
-- -- "documentation",
195+
-- -- "detail",
196+
-- -- "additionalTextEdits",
197+
-- -- },
198+
-- -- }
199+
--
200+
-- if not lspconfig.emmet_ls then
201+
-- configs.emmet_ls = {
202+
-- default_config = {
203+
-- cmd = { "emmet-ls", "--stdio" },
204+
-- filetypes = {
205+
-- "html",
206+
-- "css",
207+
-- "javascript",
208+
-- "typescript",
209+
-- "typescriptreact",
210+
-- "javascriptreact",
211+
-- "svelte",
212+
-- "vue",
213+
-- },
214+
-- root_dir = function(fname)
215+
-- return vim.loop.cwd()
216+
-- end,
217+
-- settings = {},
218+
-- },
219+
-- }
220+
-- end
221+
-- lspconfig.emmet_ls.setup({ capabilities = capabilities })
222+
-- end,
223+
-- },
224+
}
225+
226+
-- Autocommands (https://neovim.io/doc/user/autocmd.html)
227+
-- lvim.autocommands.custom_groups = {
228+
-- { "BufWinEnter", "*.lua", "setlocal ts=8 sw=8" },
229+
-- }
230+
231+
-- Autocommand create folder(s) for new file
232+
vim.cmd 'source ~/.config/lvim/vimrc-auto-mkdir.vim'

lvim/vimrc-auto-mkdir.vim

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
augroup vimrc-auto-mkdir
2+
autocmd!
3+
autocmd BufWritePre * call s:auto_mkdir(expand('<afile>:p:h'), v:cmdbang)
4+
function! s:auto_mkdir(dir, force)
5+
if !isdirectory(a:dir)
6+
\ && (a:force
7+
\ || input("'" . a:dir . "' does not exist. Create? [y/N]") =~? '^y\%[es]$')
8+
call mkdir(iconv(a:dir, &encoding, &termencoding), 'p')
9+
endif
10+
endfunction
11+
augroup END
12+

makesymlinks.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@
88

99
dir=~/Git/dotfiles # dotfiles directory
1010
olddir=~/.dotfiles_old # old dotfiles backup directory
11-
files="brewfile vim_pluginsrc aliases bashrc zshrc gitconfig bash_profile vimrc vim gitignore" # list of files/folders to symlink in homedi
11+
lvimconfigdir=~/.config/lvim
12+
files="brewfile vim_pluginsrc aliases bashrc zshrc gitconfig bash_profile vimrc vim gitignore" # list of files/folders to symlink in homedir
13+
lvimfiles="config.lua vimrc-auto-mkdir.vim"
14+
configfolder="lvim"
1215

1316
##########
1417

@@ -30,5 +33,20 @@ for file in $files; do
3033
ln -f -s $dir/$file ~/.$file
3134
done
3235

36+
for file in $lvimfiles; do
37+
echo "Moving existing config files ($lvimfiles) from $lvimconfigdir to $olddir"
38+
mv $lvimconfigdir/$file $olddir
39+
echo "Creating symlink to $file in $lvimconfigdir"
40+
ln -f -s $dir/$configfolder/$file $lvimconfigdir/$file
41+
done
42+
43+
# move any existing folder in .config to dotfiles_old, then create symlinks
44+
# for folder in $configfolders; do
45+
# echo "Backing up $folder in $configdir to .dotfiles_old"
46+
# mv $configdir/$folder $olddir
47+
# echo "Creating symlink to $folder in home $configdir directory."
48+
# ln -f -s $dir/$folder $configdir/$folder
49+
# done
50+
3351
# installs antibody if needed
3452
$dir/antibody/install.sh

zshrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export VIMPLUG=$DOTFILES/vim/plug.vim
1515
export HOMEBREW_BUNDLE_FILE=~/.brewfile
1616
export N_PREFIX=$HOME/.n
1717
export PATH="$N_PREFIX/bin:$PATH" # use n for node versions
18+
export DOTNET_CLI_TELEMETRY_OPTOUT='false'
1819

1920
source $HOME/.vim_pluginsrc
2021

@@ -53,3 +54,12 @@ done
5354
unset config_files updated_at
5455

5556
eval "$(starship init zsh)"
57+
58+
#Ruby
59+
export PATH="$HOME/.rbenv/bin:$PATH" # rbenv ruby version manager
60+
eval "$(rbenv init -)"
61+
62+
# pnpm
63+
export PNPM_HOME="/Users/zwergius/Library/pnpm"
64+
export PATH="$PNPM_HOME:$PATH"
65+
# pnpm end

0 commit comments

Comments
 (0)