mirror of
https://github.com/mikkelsvartveit/dotfiles.git
synced 2025-12-22 11:12:39 +00:00
Update config
This commit is contained in:
parent
e5ac3837a8
commit
ddca2cbe9f
6 changed files with 56 additions and 11 deletions
|
|
@ -7,6 +7,7 @@ A small collection of configuration files for macOS, including:
|
||||||
- Git
|
- Git
|
||||||
- Neovim (complete development environment with Coc and a bunch of plugins)
|
- Neovim (complete development environment with Coc and a bunch of plugins)
|
||||||
- Vim (simple configuration, no plugins)
|
- Vim (simple configuration, no plugins)
|
||||||
|
- IdeaVim (Vim emulation for JetBrains IDEs)
|
||||||
- [Karabiner](https://karabiner-elements.pqrs.org) (for [mapping CapsLock to Ctrl and Esc](https://medium.com/@pechyonkin/how-to-map-capslock-to-control-and-escape-on-mac-60523a64022b))
|
- [Karabiner](https://karabiner-elements.pqrs.org) (for [mapping CapsLock to Ctrl and Esc](https://medium.com/@pechyonkin/how-to-map-capslock-to-control-and-escape-on-mac-60523a64022b))
|
||||||
- Some wallpapers and custom app icons
|
- Some wallpapers and custom app icons
|
||||||
|
|
||||||
|
|
@ -27,8 +28,9 @@ git fetch
|
||||||
git reset --hard origin/main
|
git reset --hard origin/main
|
||||||
git branch --set-upstream-to=origin/main
|
git branch --set-upstream-to=origin/main
|
||||||
|
|
||||||
# Tell Vim to source from the right file
|
# Tell Vim and IdeaVim to source from the right file
|
||||||
echo "source ~/.config/vim/.vimrc" > .vimrc
|
echo "source ~/.config/vim/.vimrc" > .vimrc
|
||||||
|
echo "source ~/.config/ideavim/.ideavimrc" > .ideavimrc
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Install software
|
#### Install software
|
||||||
|
|
|
||||||
|
|
@ -13,11 +13,13 @@ alias ai="sgpt -se"
|
||||||
abbr x86 "arch -x86_64"
|
abbr x86 "arch -x86_64"
|
||||||
abbr v "nvim"
|
abbr v "nvim"
|
||||||
abbr lg "lazygit"
|
abbr lg "lazygit"
|
||||||
abbr s "npm run serve"
|
abbr ns "npm start"
|
||||||
abbr d "npm run dev"
|
abbr nrs "npm run serve"
|
||||||
|
abbr nrd "npm run dev"
|
||||||
|
abbr nrw "npm run watch"
|
||||||
|
abbr lrr "source venv/bin/activate.fish && litestar run --reload"
|
||||||
abbr venv "source venv/bin/activate.fish"
|
abbr venv "source venv/bin/activate.fish"
|
||||||
abbr nobrew "HOMEBREW_NO_AUTO_UPDATE=1 brew"
|
abbr nobrew "HOMEBREW_NO_AUTO_UPDATE=1 brew"
|
||||||
abbr gpf "git push --force-with-lease"
|
|
||||||
abbr ghv "gh repo view --web"
|
abbr ghv "gh repo view --web"
|
||||||
abbr pr "gh pr checkout"
|
abbr pr "gh pr checkout"
|
||||||
abbr prc "gh pr create --web"
|
abbr prc "gh pr create --web"
|
||||||
|
|
@ -68,3 +70,6 @@ end
|
||||||
# Allow running pip packages
|
# Allow running pip packages
|
||||||
export PATH="/Users/mikkelsvartveit/Library/Python/3.9/bin:$PATH"
|
export PATH="/Users/mikkelsvartveit/Library/Python/3.9/bin:$PATH"
|
||||||
|
|
||||||
|
|
||||||
|
# The next line updates PATH for the Google Cloud SDK.
|
||||||
|
if [ -f '/Users/mikkelsvartveit/Applications/google-cloud-sdk/path.fish.inc' ]; . '/Users/mikkelsvartveit/Applications/google-cloud-sdk/path.fish.inc'; end
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ set smartcase
|
||||||
set scrolloff=4
|
set scrolloff=4
|
||||||
|
|
||||||
" Press Enter to clear search highlighting
|
" Press Enter to clear search highlighting
|
||||||
nnoremap <silent><CR> :nohlsearch<CR>
|
nmap <CR> :nohlsearch<CR>
|
||||||
|
|
||||||
" Allow using uppercase W and Q commands to save/quit
|
" Allow using uppercase W and Q commands to save/quit
|
||||||
command WQ wq
|
command WQ wq
|
||||||
|
|
@ -31,8 +31,18 @@ command Wq wq
|
||||||
command W w
|
command W w
|
||||||
command Q q
|
command Q q
|
||||||
|
|
||||||
|
" Enable plugins
|
||||||
Plug 'preservim/nerdtree'
|
Plug 'preservim/nerdtree'
|
||||||
Plug 'tpope/vim-surround'
|
Plug 'tpope/vim-surround'
|
||||||
Plug 'tpope/vim-commentary'
|
Plug 'tpope/vim-commentary'
|
||||||
|
|
||||||
|
" Keymaps
|
||||||
|
nnoremap gh :action ShowErrorDescription<CR>
|
||||||
|
nnoremap gf :action QuickJavaDoc<CR>
|
||||||
nnoremap <leader>n :NERDTree<CR>
|
nnoremap <leader>n :NERDTree<CR>
|
||||||
|
nnoremap <leader>c :action GotoAction<CR>
|
||||||
|
nnoremap <leader>: :action GotoAction<CR>
|
||||||
|
nnoremap <leader>p :action GotoFile<CR>
|
||||||
|
nnoremap <leader>o :action RecentFiles<CR>
|
||||||
|
nnoremap <leader>f :action FindInPath<CR>
|
||||||
|
nnoremap <leader>d :action ActivateCommitToolWindow<CR>
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
"leap.nvim": { "branch": "main", "commit": "0eb3611593e135150e2f7880ec67568ccb51c17a" },
|
"leap.nvim": { "branch": "main", "commit": "0eb3611593e135150e2f7880ec67568ccb51c17a" },
|
||||||
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
|
"markdown-preview.nvim": { "branch": "master", "commit": "02cc3874738bc0f86e4b91f09b8a0ac88aef8e96" },
|
||||||
"neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" },
|
"neoscroll.nvim": { "branch": "master", "commit": "d7601c26c8a183fa8994ed339e70c2d841253e93" },
|
||||||
|
"nvim-autopairs": { "branch": "master", "commit": "e8f7dd7a72de3e7b6626c050a802000e69d53ff0" },
|
||||||
"nvim-scrollbar": { "branch": "main", "commit": "f85b29805cf917f9b1d5ff0c9a52c5b1bdca5943" },
|
"nvim-scrollbar": { "branch": "main", "commit": "f85b29805cf917f9b1d5ff0c9a52c5b1bdca5943" },
|
||||||
"nvim-toggleterm.lua": { "branch": "main", "commit": "a5638b2206c3930a16a24e5c184dddd572f8cd34" },
|
"nvim-toggleterm.lua": { "branch": "main", "commit": "a5638b2206c3930a16a24e5c184dddd572f8cd34" },
|
||||||
"nvim-tree.lua": { "branch": "master", "commit": "e14989c0eaa6f9c299d48f7e45ce1ed04b21180f" },
|
"nvim-tree.lua": { "branch": "master", "commit": "e14989c0eaa6f9c299d48f7e45ce1ed04b21180f" },
|
||||||
|
|
|
||||||
|
|
@ -65,12 +65,6 @@ require("lazy").setup({
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
|
|
||||||
-- VSCode-like multi-cursor support
|
|
||||||
{
|
|
||||||
"mg979/vim-visual-multi",
|
|
||||||
branch = "master",
|
|
||||||
},
|
|
||||||
|
|
||||||
-- Easy commenting/uncommenting
|
-- Easy commenting/uncommenting
|
||||||
{
|
{
|
||||||
"numToStr/Comment.nvim",
|
"numToStr/Comment.nvim",
|
||||||
|
|
@ -85,6 +79,37 @@ require("lazy").setup({
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
-- Auto-match brackets, quotes etc.
|
||||||
|
{
|
||||||
|
'windwp/nvim-autopairs',
|
||||||
|
event = "InsertEnter",
|
||||||
|
opts = {},
|
||||||
|
-- Make it play well with CoC
|
||||||
|
init = function()
|
||||||
|
local remap = vim.api.nvim_set_keymap
|
||||||
|
local npairs = require('nvim-autopairs')
|
||||||
|
npairs.setup({map_cr=false})
|
||||||
|
|
||||||
|
_G.MUtils= {}
|
||||||
|
|
||||||
|
MUtils.completion_confirm=function()
|
||||||
|
if vim.fn["coc#pum#visible"]() ~= 0 then
|
||||||
|
return vim.fn["coc#pum#confirm"]()
|
||||||
|
else
|
||||||
|
return npairs.autopairs_cr()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
remap('i' , '<CR>','v:lua.MUtils.completion_confirm()', {expr = true , noremap = true})
|
||||||
|
end
|
||||||
|
},
|
||||||
|
|
||||||
|
-- VSCode-like multi-cursor support
|
||||||
|
{
|
||||||
|
"mg979/vim-visual-multi",
|
||||||
|
branch = "master",
|
||||||
|
},
|
||||||
|
|
||||||
-- GitHub Copilot
|
-- GitHub Copilot
|
||||||
{
|
{
|
||||||
"github/copilot.vim",
|
"github/copilot.vim",
|
||||||
|
|
@ -149,6 +174,7 @@ require("lazy").setup({
|
||||||
{"<leader>b", "<cmd>Telescope buffers<CR>", noremap = true, silent = true},
|
{"<leader>b", "<cmd>Telescope buffers<CR>", noremap = true, silent = true},
|
||||||
{"<leader>o", "<cmd>Telescope oldfiles<CR>", noremap = true, silent = true},
|
{"<leader>o", "<cmd>Telescope oldfiles<CR>", noremap = true, silent = true},
|
||||||
{"<leader>t", "<cmd>Telescope tags<CR>", noremap = true, silent = true},
|
{"<leader>t", "<cmd>Telescope tags<CR>", noremap = true, silent = true},
|
||||||
|
{"<leader>c", "<cmd>Telescope commands<CR>", noremap = true, silent = true},
|
||||||
{"<leader>:", "<cmd>Telescope commands<CR>", noremap = true, silent = true},
|
{"<leader>:", "<cmd>Telescope commands<CR>", noremap = true, silent = true},
|
||||||
{"<leader>d", "<cmd>Telescope git_status<CR>", noremap = true, silent = true},
|
{"<leader>d", "<cmd>Telescope git_status<CR>", noremap = true, silent = true},
|
||||||
{"<leader><leader>", "<cmd>Telescope resume<CR>", noremap = true, silent = true},
|
{"<leader><leader>", "<cmd>Telescope resume<CR>", noremap = true, silent = true},
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ nnoremap <leader>b <cmd>call VSCodeNotify('workbench.action.showAllEditors')<cr>
|
||||||
nnoremap <leader>o <cmd>call VSCodeNotify('workbench.action.quickOpen')<cr>
|
nnoremap <leader>o <cmd>call VSCodeNotify('workbench.action.quickOpen')<cr>
|
||||||
nnoremap <leader>f <cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>
|
nnoremap <leader>f <cmd>call VSCodeNotify('workbench.action.findInFiles')<cr>
|
||||||
nnoremap <leader>: <cmd>call VSCodeNotify('workbench.action.showCommands')<cr>
|
nnoremap <leader>: <cmd>call VSCodeNotify('workbench.action.showCommands')<cr>
|
||||||
|
nnoremap <leader>c <cmd>call VSCodeNotify('workbench.action.showCommands')<cr>
|
||||||
nnoremap <leader>d <cmd>call VSCodeNotify('workbench.view.scm')<cr>
|
nnoremap <leader>d <cmd>call VSCodeNotify('workbench.view.scm')<cr>
|
||||||
nnoremap <leader>n <cmd>call VSCodeNotify('workbench.action.toggleSidebarVisibility')<cr>
|
nnoremap <leader>n <cmd>call VSCodeNotify('workbench.action.toggleSidebarVisibility')<cr>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue