Skip to content

Commit

Permalink
Add bun and Flutter
Browse files Browse the repository at this point in the history
  • Loading branch information
serverwentdown committed Feb 15, 2024
1 parent 5af918e commit 46695be
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .config/nvim/init.vim
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ Plug 'hrsh7th/cmp-path'
Plug 'hrsh7th/cmp-cmdline'
Plug 'hrsh7th/nvim-cmp'

" languages: dart/flutter
Plug 'nvim-lua/plenary.nvim'
Plug 'stevearc/dressing.nvim'
Plug 'akinsho/flutter-tools.nvim'

" snippets

Plug 'hrsh7th/cmp-vsnip'
Expand Down
15 changes: 13 additions & 2 deletions .config/nvim/lua/lsp.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ vim.keymap.set('n', '<space>q', vim.diagnostic.setloclist, opts)

-- Use an on_attach function to only map the following keys
-- after the language server attaches to the current buffer
local on_attach = function(client, bufnr)
local on_attach = function(bufnr)
-- Enable completion triggered by <c-x><c-o>
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')

Expand All @@ -32,6 +32,14 @@ local on_attach = function(client, bufnr)
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
end
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(ev)
on_attach(ev.buf)
end,
})
local on_attach_mason = function(client, bufnr)
on_attach(bufnr)
end

-- Add additional capabilities supported by nvim-cmp
local capabilities = require('cmp_nvim_lsp').default_capabilities()
Expand All @@ -43,12 +51,15 @@ require('mason-lspconfig').setup()
require('mason-lspconfig').setup_handlers {
function (server_name)
lspconfig[server_name].setup {
on_attach = on_attach,
on_attach = on_attach_mason,
capabilities = capabilities,
}
end
}

-- Configure dart/flutter
require("flutter-tools").setup {}

-- Configure nvim-cmp
local cmp = require('cmp')
cmp.setup {
Expand Down
10 changes: 10 additions & 0 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ setup_nvm_on_demand() {
}
export NVM_DIR="$HOME/.nvm"
[[ -d "$NVM_DIR" ]] && setup_nvm_on_demand
setup_bun() {
[ -s "/var/home/ambrose/.bun/_bun" ] && source "/var/home/ambrose/.bun/_bun"
export PATH="$BUN_INSTALL/bin:$PATH"
}
export BUN_INSTALL="$HOME/.bun"
[[ -d "$BUN_INSTALL" ]] && setup_bun
setup_ruby() {
export PATH="$(ruby -e 'puts Gem.user_dir')/bin:$PATH"
}
Expand All @@ -127,6 +133,10 @@ setup_g() {
export PATH="$HOME/go/bin:$PATH" GOPATH="$HOME/go" GOROOT="$HOME/.go" # g-install: do NOT edit, see https://github.com/stefanmaric/g
}
[[ -f "$HOME/go/bin/g" ]] && setup_g
setup_rancher_desktop() {
export PATH="$HOME/.rd/bin:$PATH"
}
[[ -d "$HOME/.rd/bin" ]] && setup_rancher_desktop
setup_android_sdk() {
# See ~/.local/bin/install_android_sdk
export ANDROID_SDK_ROOT="$HOME/.android/sdk"
Expand Down

0 comments on commit 46695be

Please sign in to comment.