Add bun and Flutter
parent
5af918e8a4
commit
46695bea7f
|
@ -30,6 +30,11 @@ Plug 'hrsh7th/cmp-path'
|
||||||
Plug 'hrsh7th/cmp-cmdline'
|
Plug 'hrsh7th/cmp-cmdline'
|
||||||
Plug 'hrsh7th/nvim-cmp'
|
Plug 'hrsh7th/nvim-cmp'
|
||||||
|
|
||||||
|
" languages: dart/flutter
|
||||||
|
Plug 'nvim-lua/plenary.nvim'
|
||||||
|
Plug 'stevearc/dressing.nvim'
|
||||||
|
Plug 'akinsho/flutter-tools.nvim'
|
||||||
|
|
||||||
" snippets
|
" snippets
|
||||||
|
|
||||||
Plug 'hrsh7th/cmp-vsnip'
|
Plug 'hrsh7th/cmp-vsnip'
|
||||||
|
|
|
@ -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
|
-- Use an on_attach function to only map the following keys
|
||||||
-- after the language server attaches to the current buffer
|
-- 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>
|
-- Enable completion triggered by <c-x><c-o>
|
||||||
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
vim.api.nvim_buf_set_option(bufnr, 'omnifunc', 'v:lua.vim.lsp.omnifunc')
|
||||||
|
|
||||||
|
@ -32,6 +32,14 @@ local on_attach = function(client, bufnr)
|
||||||
vim.keymap.set('n', 'gr', vim.lsp.buf.references, bufopts)
|
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)
|
vim.keymap.set('n', '<space>f', function() vim.lsp.buf.format { async = true } end, bufopts)
|
||||||
end
|
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
|
-- Add additional capabilities supported by nvim-cmp
|
||||||
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
local capabilities = require('cmp_nvim_lsp').default_capabilities()
|
||||||
|
@ -43,12 +51,15 @@ require('mason-lspconfig').setup()
|
||||||
require('mason-lspconfig').setup_handlers {
|
require('mason-lspconfig').setup_handlers {
|
||||||
function (server_name)
|
function (server_name)
|
||||||
lspconfig[server_name].setup {
|
lspconfig[server_name].setup {
|
||||||
on_attach = on_attach,
|
on_attach = on_attach_mason,
|
||||||
capabilities = capabilities,
|
capabilities = capabilities,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- Configure dart/flutter
|
||||||
|
require("flutter-tools").setup {}
|
||||||
|
|
||||||
-- Configure nvim-cmp
|
-- Configure nvim-cmp
|
||||||
local cmp = require('cmp')
|
local cmp = require('cmp')
|
||||||
cmp.setup {
|
cmp.setup {
|
||||||
|
|
10
.zshrc
10
.zshrc
|
@ -115,6 +115,12 @@ setup_nvm_on_demand() {
|
||||||
}
|
}
|
||||||
export NVM_DIR="$HOME/.nvm"
|
export NVM_DIR="$HOME/.nvm"
|
||||||
[[ -d "$NVM_DIR" ]] && setup_nvm_on_demand
|
[[ -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() {
|
setup_ruby() {
|
||||||
export PATH="$(ruby -e 'puts Gem.user_dir')/bin:$PATH"
|
export PATH="$(ruby -e 'puts Gem.user_dir')/bin:$PATH"
|
||||||
}
|
}
|
||||||
|
@ -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
|
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
|
[[ -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() {
|
setup_android_sdk() {
|
||||||
# See ~/.local/bin/install_android_sdk
|
# See ~/.local/bin/install_android_sdk
|
||||||
export ANDROID_SDK_ROOT="$HOME/.android/sdk"
|
export ANDROID_SDK_ROOT="$HOME/.android/sdk"
|
||||||
|
|
Loading…
Reference in New Issue