1679087700
AstroNvim is an aesthetic and feature-rich neovim config that is extensible and easy to use with a great set of plugins
auto_install
feature with Treesitter):help clipboard-tool
for supported solutions)<leader>fw
)<leader>tl
or <leader>gg
)<leader>tu
)<leader>tt
)<leader>tp
)<leader>tn
)Note when using default theme: For MacOS, the default terminal does not have true color support. You will need to use iTerm2 or another terminal emulator that has true color support.
mv ~/.config/nvim ~/.config/nvim.bak
mv ~/.local/share/nvim ~/.local/share/nvim.bak
git clone --depth 1 https://github.com/AstroNvim/AstroNvim ~/.config/nvim
nvim
Enter :LspInstall
followed by the name of the server you want to install
Example: :LspInstall pyright
Enter :TSInstall
followed by the name of the language you want to install
Example: :TSInstall python
Enter :DapInstall
followed by the name of the debugger you want to install
Example: :DapInstall python
Run :Lazy check
to check for plugin updates
Run :Lazy update
to apply any pending plugin updates
Run :Lazy clean
to remove any disabled or unused plugins
Run :Lazy sync
to update and clean plugins
Run :AstroUpdate
to get the latest updates from the repository
Run :AstroUpdatePackages
(<leader>pa
) to update both Neovim plugins and Mason packages
AstroNvim Documentation Core AstroNvim LUA API Documentation
There have been some great review videos released by members of the community! Here are a few:
If you plan to contribute, please check the contribution guidelines first.
Sincere appreciation to the following repositories, plugin authors and the entire neovim community out there that made the development of AstroNvim possible.
Author: AstroNvim
Source Code: https://github.com/AstroNvim/AstroNvim
License: GPL-3.0 license
1678560240
codeium.vim
Free, ultrafast Copilot alternative for Vim and Neovim
Codeium autocompletes your code with AI in all major IDEs. We launched this implementation of the Codeium plugin for Vim and Neovim to bring this modern coding superpower to more developers. Check out our playground if you want to quickly try out Codeium online.
Contributions are welcome! Feel free to submit pull requests and issues related to the plugin.
Install Vim (at least 9.0.0185) or Neovim (at least 0.6)
Install Exafunction/codeium.vim
using your vim plugin manager of choice, or manually. See Installation Options below.
Run :Codeium Auth
to set up the plugin and start using Codeium.
You can run :help codeium
for a full list of commands and configuration options, or see this guide for a quick tutorial on how to use Codeium.
For a full list of configuration options you can run :help codeium
. A few of the most popular options are highlighted below.
Codeium provides the following functions to control suggestions:
Action | Function | Default Binding |
---|---|---|
Clear current suggestion | codeium#Clear() | <C-]> |
Next suggestion | codeium#CycleCompletions(1) | <M-]> |
Previous suggestion | codeium#CycleCompletions(-1) | <M-[> |
Insert suggestion | codeium#Accept() | <Tab> |
Manually trigger suggestion | codeium#Complete() | <M-Bslash> |
Codeium's default keybindings can be disabled by setting
let g:codeium_disable_bindings = 1
or in Neovim:
vim.g.codeium_disable_bindings = 1
If you'd like to just disable the <Tab>
binding, you can alternatively use the g:codeium_no_map_tab
option.
If you'd like to bind the actions above to different keys, this might look something like the following in Vim:
imap <script><silent><nowait><expr> <C-g> codeium#Accept()
imap <C-;> <Cmd>call codeium#CycleCompletions(1)<CR>
imap <C-,> <Cmd>call codeium#CycleCompletions(-1)<CR>
imap <C-x> <Cmd>call codeium#Clear()<CR>
Or in Neovim (using wbthomason/packer.nvim or folke/lazy.nvim):
-- Remove the `use` here if you're using folke/lazy.nvim.
use {
'Exafunction/codeium.vim',
config = function ()
-- Change '<C-g>' here to any keycode you like.
vim.keymap.set('i', '<C-g>', function () return vim.fn['codeium#Accept']() end, { expr = true })
vim.keymap.set('i', '<c-;>', function() return vim.fn['codeium#CycleCompletions'](1) end, { expr = true })
vim.keymap.set('i', '<c-,>', function() return vim.fn['codeium#CycleCompletions'](-1) end, { expr = true })
vim.keymap.set('i', '<c-x>', function() return vim.fn['codeium#Clear']() end, { expr = true })
end
}
(Make sure that you ran :Codeium Auth
after installation.)
Codeium can be disabled for particular filetypes by setting the g:codeium_filetypes
variable in your vim config file (vimrc/init.vim):
let g:codeium_filetypes = {
\ "bash": v:false,
\ "typescript": v:true,
\ }
Codeium is enabled by default for most filetypes.
You can also disable codeium by default with the g:codeium_enabled
variable:
let g:codeium_enabled = v:false
Instead, if you would like to just disable the automatic triggering of completions:
let g:codeium_manual = v:true
Codeium status can be generated by calling codeium#GetStatusString()
function. It produce 3 char long string with status:
'3/8'
- third suggestion out of 8'0'
- Codeium returned no suggestions'*'
- waiting for Codeium responseIn normal mode, status shows if Codeium is enabled or disabled by showing 'ON'
or 'OFF'
.
In order to show it in status line add following line to your .vimrc
:
set statusline+=\{β¦\}%3{codeium#GetStatusString()}
Shorter variant without Codeium logo:
set statusline+=%3{codeium#GetStatusString()}
Please check :help statusline
for further information about building statusline in VIM.
For vim-airline extension you can use following config:
let g:airline_section_y = '{β¦}%3{codeium#GetStatusString()}'
Plug 'Exafunction/codeium.vim'
Plugin 'Exafunction/codeium.vim'
use 'Exafunction/codeium.vim'
Run the following. On windows, you can replace ~/.vim
with $HOME/vimfiles
:
git clone https://github.com/Exafunction/codeium.vim ~/.vim/pack/Exafunction/start/codeium.vim
Run the following. On windows, you can replace ~/.config
with $HOME/AppData/Local
:
git clone https://github.com/Exafunction/codeium.vim ~/.config/nvim/pack/Exafunction/start/codeium.vim
Author: Exafunction
Source Code: https://github.com/Exafunction/codeium.vim
License: MIT license
#typescript #javascript #ruby #python #vim #go #editor #rust
1678220820
CosmicNvim is a lightweight and opinionated Neovim config for web development, specifically designed to provide a π« COSMIC programming experience!
Full featured native LSP functionality!
While CosmicNvim is geared specifically toward TypeScript/JavaScript development, it should be able to provide a great experience with any LSP supported language.
# move to config dir
cd ~/.config
# back up current config
cp -r nvim nvim.backup
# clone repository
git clone git@github.com:CosmicNvim/CosmicNvim.git nvim
# open nvim and install plugins
nvim
By default, this will assume the Cosmic git directory is placed at vim.fn.stdpath('config')
, i.e. ~/.config/nvim
. If you are symlinking your pulled repo to ~/.config/nvim
, you must define the shell environment variable COSMICNVIM_INSTALL_DIR
that points to your installation.
Additional CosmicNvim installation details.
Additional LSP server installation details.
CosmicNvim uninstallation details.
New documentation coming soon!
Updates CosmicNvim to the latest version
:CosmicUpdate
Author: CosmicNvim
Source Code: https://github.com/CosmicNvim/CosmicNvim
License: GPL-3.0 license
1677712080
Tsserver language server extension for coc.nvim.
Tsserver is part of TypeScript which provide rich language features for javascript and typescript.
This extension is a fork of typescript-language-features
extension which is bundled with VSCode. File type detect and syntax highlight are not supported by this extension, use other vim plugin instead.
Important note: from v2.0.0, tsserver module resolved first from global configuration tsserver.tsdk
and use bundled module when not found, if tsserver.useLocalTsdk
is enabled, workspace folder configured tsserver.tsdk
or typescript module inside current workspace folder would be used when exists.
In your vim/neovim, run command:
:CocInstall coc-tsserver
For yarn2 ( >= v2.0.0-rc.36) user want to use local typescript module:
Run command yarn dlx @yarnpkg/sdks vim
, which will generate .vim/coc-settings.json
, with content:
{
"eslint.packageManager": "yarn",
"eslint.nodePath": ".yarn/sdks",
"workspace.workspaceFolderCheckCwd": false,
"tsserver.tsdk": ".yarn/sdks/typescript/lib"
}
Almost the same as VSCode.
tsserver.reloadProjects
tsserver.openTsServerLog
tsserver.goToProjectConfig
tsserver.restart
tsserver.watchBuild
tsserver.findAllFileReferences
typescript.inlayHints
or javascript.inlayHints
.Tsserver module first resolved from your local workspace. If it's not found, use tsserver from tsserver.tsdk configuration or use bundled tsserver with this extension.
Commands contributed to :CocList commands
tsserver.reloadProjects
Reload current projecttsserver.openTsServerLog
Open log file of tsserver.tsserver.goToProjectConfig
Open project config file.tsserver.restart
Restart tsservertsserver.findAllFileReferences
Find File Referencestsserver.goToSourceDefinition
Go to Source Definitiontsserver.watchBuild
Run tsc --watch
for current project by use vim's job feature.tsserver.executeAutofix
Fix autofixable problems of current document.tsserver.chooseVersion
Choose different typescript version for current project.Checkout :h coc-configuration
for guide of coc.nvim's configuration.
tsserver.enable
: Enable running of tsserver. Default: true
tsserver.tsconfigPath
: Path to tsconfig file for the tsserver.watchBuild
command. Default: "tsconfig.json"
tsserver.locale
: Sets the locale used to report JavaScript and TypeScript errors. Defaults to use VS Code's locale. Default: "auto"
Valid options: ["auto","de","es","en","fr","it","ja","ko","ru","zh-CN","zh-TW"]tsserver.useLocalTsdk
: Use tsserver from typescript module in workspace folder, ignore tsserver.tsdk configuration. Default: false
tsserver.maxTsServerMemory
: Set the maximum amount of memory to allocate to the TypeScript server process Default: 3072
tsserver.watchOptions
: Configure which watching strategies should be used to keep track of files and directories. Requires using TypeScript 3.8+ in the workspace.tsserver.tsdk
: Specifies the folder path to the tsserver and lib*.d.ts
files under a TypeScript install to use for IntelliSense, for example: ./node_modules/typescript/lib
. - When specified as a user setting, the TypeScript version from tsserver.tsdk
automatically replaces the built-in TypeScript version. - When specified as a workspace setting, the tsserver is used when tsserver.useLocalTsdk
is true. Use command :CocCommand tsserver.chooseVersion
to choose different typescript version. Default: ""
tsserver.npm
: Specifies the path to the npm executable used for Automatic Type Acquisition. Default: ""
tsserver.log
: Log level of tsserver Default: "off"
Valid options: ["normal","terse","verbose","off"]tsserver.trace.server
: Trace level of tsserver Default: "off"
Valid options: ["off","messages","verbose"]tsserver.enableTracing
: Enables tracing TS server performance to a directory. These trace files can be used to diagnose TS Server performance issues. The log may contain file paths, source code, and other potentially sensitive information from your project. Default: false
tsserver.pluginPaths
: Additional paths to discover TypeScript Language Service plugins. Default: []
tsserver.reportStyleChecksAsWarnings
: Report style checks as warnings. Default: true
tsserver.implicitProjectConfig.checkJs
: Enable checkJs for implicit project Default: false
tsserver.implicitProjectConfig.module
: Sets the module system for the program. See more: https://www.typescriptlang.org/tsconfig#module. Default: "ESNext"
Valid options: ["CommonJS","AMD","System","UMD","ES6","ES2015","ES2020","ESNext","None","ES2022","Node12","NodeNext"]tsserver.implicitProjectConfig.target
: Set target JavaScript language version for emitted JavaScript and include library declarations. See more: https://www.typescriptlang.org/tsconfig#target. Default: "ES2020"
Valid options: ["ES3","ES5","ES6","ES2015","ES2016","ES2017","ES2018","ES2019","ES2020","ES2021","ES2022","ESNext"]tsserver.implicitProjectConfig.strictNullChecks
: Enable/disable strict null checks in JavaScript and TypeScript files that are not part of a project. Existing jsconfig.json
or tsconfig.json
files override this setting. Default: true
tsserver.implicitProjectConfig.strictFunctionTypes
: Enable/disable strict function types in JavaScript and TypeScript files that are not part of a project. Existing jsconfig.json
or tsconfig.json
files override this setting. Default: true
tsserver.implicitProjectConfig.experimentalDecorators
: Enable experimentalDecorators for implicit project Default: false
tsserver.disableAutomaticTypeAcquisition
: Disables automatic type acquisition. Automatic type acquisition fetches @types
packages from npm to improve IntelliSense for external libraries. Default: false
tsserver.useSyntaxServer
: Controls if TypeScript launches a dedicated server to more quickly handle syntax related operations, such as computing code folding. Default: "auto"
Valid options: ["always","never","auto"]tsserver.experimental.enableProjectDiagnostics
: (Experimental) Enables project wide error reporting. Default: false
typescript.check.npmIsInstalled
: Check if npm is installed for Automatic Type Acquisition. Default: true
typescript.showUnused
: Show unused variable hint. Default: true
typescript.showDeprecated
: Show deprecated variable hint. Default: true
typescript.updateImportsOnFileMove.enabled
: Enable/disable automatic updating of import paths when you rename or move a file in VS Code. Default: "prompt"
Valid options: ["prompt","always","never"]typescript.implementationsCodeLens.enabled
: Enable codeLens for implementations Default: false
typescript.referencesCodeLens.enabled
: Enable codeLens for references Default: false
typescript.referencesCodeLens.showOnAllFunctions
: Enable/disable references CodeLens on all functions in typescript files. Default: false
typescript.preferences.importModuleSpecifier
: Preferred path style for auto imports. Default: "shortest"
Valid options: ["shortest","relative","non-relative","project-relative"]typescript.preferences.importModuleSpecifierEnding
: Preferred path ending for auto imports. Default: "auto"
Valid options: ["auto","minimal","index","js"]typescript.preferences.jsxAttributeCompletionStyle
: Preferred style for JSX attribute completions. Default: "auto"
Valid options: ["auto","braces","none"]typescript.preferences.includePackageJsonAutoImports
: Enable/disable searching package.json
dependencies for available auto imports. Default: "auto"
Valid options: ["auto","on","off"]typescript.preferences.quoteStyle
: Preferred quote style to use for quick fixes. Default: "auto"
Valid options: ["auto","single","double"]typescript.preferences.useAliasesForRenames
: Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace. Default: true
typescript.preferences.autoImportFileExcludePatterns
: Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.typescript.preferences.renameShorthandProperties
: Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace. Default: true
typescript.suggestionActions.enabled
: Enable/disable suggestion diagnostics for TypeScript files in the editor. Requires using TypeScript 2.8 or newer in the workspace. Default: true
typescript.validate.enable
: Enable/disable TypeScript validation. Default: true
typescript.suggest.enabled
: Enabled/disable autocomplete suggestions. Default: true
typescript.suggest.paths
: Enable/disable suggest paths in import statement and require calls Default: true
typescript.suggest.autoImports
: Enable/disable auto import suggests. Default: true
typescript.suggest.completeFunctionCalls
: Enable snippet for method suggestion Default: true
typescript.suggest.includeCompletionsForImportStatements
: Enable/disable auto-import-style completions on partially-typed import statements. Requires using TypeScript 4.3+ in the workspace. Default: true
typescript.suggest.includeCompletionsWithSnippetText
: Enable/disable snippet completions from TS Server. Requires using TypeScript 4.3+ in the workspace. Default: true
typescript.suggest.classMemberSnippets.enabled
: Enable/disable snippet completions for class members. Requires using TypeScript 4.5+ in the workspace Default: true
typescript.suggest.jsdoc.generateReturns
: Enable/disable generating @return
annotations for JSDoc templates. Requires using TypeScript 4.2+ in the workspace. Default: true
typescript.format.enable
: Enable format for typescript. Default: true
typescript.format.insertSpaceAfterCommaDelimiter
: Defines space handling after a comma delimiter. Default: true
typescript.format.insertSpaceAfterConstructor
: Defines space handling after the constructor keyword. Default: false
typescript.format.insertSpaceAfterSemicolonInForStatements
: Defines space handling after a semicolon in a for statement. Default: true
typescript.format.insertSpaceBeforeAndAfterBinaryOperators
: Defines space handling after a binary operator. Default: true
typescript.format.insertSpaceAfterKeywordsInControlFlowStatements
: Defines space handling after keywords in a control flow statement. Default: true
typescript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions
: Defines space handling after function keyword for anonymous functions. Default: true
typescript.format.insertSpaceBeforeFunctionParenthesis
: Defines space handling before function argument parentheses. Default: false
typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis
: Defines space handling after opening and before closing non-empty parenthesis. Default: false
typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets
: Defines space handling after opening and before closing non-empty brackets. Default: false
typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces
: Defines space handling after opening and before closing empty braces. Default: false
typescript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces
: Defines space handling after opening and before closing non-empty braces. Default: false
typescript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces
: Defines space handling after opening and before closing template string braces. Default: false
typescript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces
: Defines space handling after opening and before closing JSX expression braces. Default: false
typescript.format.insertSpaceAfterTypeAssertion
: Defines space handling after type assertions in TypeScript. Default: false
typescript.format.placeOpenBraceOnNewLineForFunctions
: Defines whether an open brace is put onto a new line for functions or not. Default: false
typescript.format.placeOpenBraceOnNewLineForControlBlocks
: Defines whether an open brace is put onto a new line for control blocks or not. Default: false
typescript.format.semicolons
: Defines handling of optional semicolons. Requires using TypeScript 3.7 or newer in the workspace. Default: "ignore"
Valid options: ["ignore","insert","remove"]typescript.suggest.includeAutomaticOptionalChainCompletions
: Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires TS 3.7+ and strict null checks to be enabled. Default: true
typescript.workspaceSymbols.scope
: Controls which files are searched by go to symbol in workspace. Default: "allOpenProjects"
Valid options: ["allOpenProjects","currentProject"]typescript.autoClosingTags
: Enable/disable automatic closing of JSX tags. Default: true
javascript.showUnused
: Show unused variable hint. Default: true
javascript.showDeprecated
: Show deprecated variable hint. Default: true
javascript.updateImportsOnFileMove.enabled
: Enable/disable automatic updating of import paths when you rename or move a file in VS Code. Default: "prompt"
Valid options: ["prompt","always","never"]javascript.implementationsCodeLens.enabled
: Enable/disable implementations CodeLens. This CodeLens shows the implementers of an interface. Default: false
javascript.referencesCodeLens.enabled
: Enable/disable references CodeLens in JavaScript files. Default: false
javascript.referencesCodeLens.showOnAllFunctions
: Enable/disable references CodeLens on all functions in JavaScript files. Default: false
javascript.preferences.importModuleSpecifier
: Preferred path style for auto imports. Default: "shortest"
Valid options: ["shortest","relative","non-relative","project-relative"]javascript.preferences.importModuleSpecifierEnding
: Preferred path ending for auto imports. Default: "auto"
Valid options: ["auto","minimal","index","js"]javascript.preferences.jsxAttributeCompletionStyle
: Preferred style for JSX attribute completions. Default: "auto"
Valid options: ["auto","braces","none"]javascript.preferences.quoteStyle
: Preferred quote style to use for quick fixes. Default: "auto"
Valid options: ["auto","single","double"]javascript.preferences.useAliasesForRenames
: Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace. Default: true
javascript.preferences.autoImportFileExcludePatterns
: Specify glob patterns of files to exclude from auto imports. Requires using TypeScript 4.8 or newer in the workspace.javascript.preferences.renameShorthandProperties
: Enable/disable introducing aliases for object shorthand properties during renames. Requires using TypeScript 3.4 or newer in the workspace. Default: true
javascript.validate.enable
: Enable/disable JavaScript validation. Default: true
javascript.suggestionActions.enabled
: Enable/disable suggestion diagnostics for JavaScript files in the editor. Requires using TypeScript 2.8 or newer in the workspace. Default: true
javascript.suggest.names
: Enable/disable including unique names from the file in JavaScript suggestions. Note that name suggestions are always disabled in JavaScript code that is semantically checked using @ts-check
or checkJs
. Default: true
javascript.suggest.enabled
: Enabled/disable autocomplete suggestions. Default: true
javascript.suggest.paths
: Enable/disable suggest paths in import statement and require calls Default: true
javascript.suggest.autoImports
: Enable/disable auto import suggests. Default: true
javascript.suggest.completeFunctionCalls
: Enable snippet for method suggestion Default: true
javascript.suggest.includeCompletionsForImportStatements
: Enable/disable auto-import-style completions on partially-typed import statements. Requires using TypeScript 4.3+ in the workspace. Default: true
javascript.suggest.classMemberSnippets.enabled
: Enable/disable snippet completions for class members. Requires using TypeScript 4.5+ in the workspace Default: true
javascript.suggest.jsdoc.generateReturns
: Enable/disable generating @return
annotations for JSDoc templates. Requires using TypeScript 4.2+ in the workspace. Default: true
javascript.format.enable
: Enable format for javascript. Default: true
javascript.format.insertSpaceAfterCommaDelimiter
: Default: true
javascript.format.insertSpaceAfterConstructor
: Default: false
javascript.format.insertSpaceAfterSemicolonInForStatements
: Default: true
javascript.format.insertSpaceBeforeAndAfterBinaryOperators
: Default: true
javascript.format.insertSpaceAfterKeywordsInControlFlowStatements
: Default: true
javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions
: Default: true
javascript.format.insertSpaceBeforeFunctionParenthesis
: Default: false
javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis
: Default: false
javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets
: Default: false
javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces
: Default: false
javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces
: Default: false
javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces
: Default: false
javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces
: Default: false
javascript.format.insertSpaceAfterTypeAssertion
: Default: false
javascript.format.placeOpenBraceOnNewLineForFunctions
: Default: false
javascript.format.placeOpenBraceOnNewLineForControlBlocks
: Default: false
javascript.suggest.includeAutomaticOptionalChainCompletions
: Enable/disable showing completions on potentially undefined values that insert an optional chain call. Requires TS 3.7+ and strict null checks to be enabled. Default: true
typescript.inlayHints.parameterNames.enabled
: Enable/disable inlay hints of parameter names. Default: "none"
Valid options: ["none","literals","all"]typescript.inlayHints.parameterNames.suppressWhenArgumentMatchesName
: Suppress parameter name hints on arguments whose text is identical to the parameter name. Default: true
typescript.inlayHints.parameterTypes.enabled
: Enable/disable inlay hints of parameter types. Default: false
typescript.inlayHints.variableTypes.enabled
: Enable/disable inlay hints of variable types. Default: false
typescript.inlayHints.propertyDeclarationTypes.enabled
: Enable/disable inlay hints of property declarations. Default: false
typescript.inlayHints.functionLikeReturnTypes.enabled
: Enable/disable inlay hints of return type for function signatures. Default: false
typescript.inlayHints.enumMemberValues.enabled
: Enable/disable inlay hints of enum member values. Default: false
typescript.inlayHints.variableTypes.suppressWhenTypeMatchesName
: Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace. Default: true
javascript.inlayHints.parameterNames.enabled
: Enable/disable inlay hints of parameter names. Default: "none"
Valid options: ["none","literals","all"]javascript.inlayHints.parameterNames.suppressWhenArgumentMatchesName
: Suppress parameter name hints on arguments whose text is identical to the parameter name. Default: true
javascript.inlayHints.parameterTypes.enabled
: Enable/disable inlay hints of parameter types. Default: false
javascript.inlayHints.variableTypes.enabled
: Enable/disable inlay hints of variable types. Default: false
javascript.inlayHints.propertyDeclarationTypes.enabled
: Enable/disable inlay hints of property declarations. Default: false
javascript.inlayHints.functionLikeReturnTypes.enabled
: Enable/disable inlay hints of return type for function signatures. Default: false
javascript.inlayHints.enumMemberValues.enabled
: Enable/disable inlay hints of enum member values. Default: false
javascript.inlayHints.variableTypes.suppressWhenTypeMatchesName
: Suppress type hints on variables whose name is identical to the type name. Requires using TypeScript 4.8+ in the workspace. Default: true
javascript.autoClosingTags
: Enable/disable automatic closing of JSX tags. Default: true
javascript.format.semicolons
: Defines handling of optional semicolons. Requires using TypeScript 3.7 or newer in the workspace. Default: "ignore"
Valid options: ["ignore","insert","remove"]javascript.suggest.completeJSDocs
: Enable/disable suggestion to complete JSDoc comments. Default: true
typescript.suggest.completeJSDocs
: Enable/disable suggestion to complete JSDoc comments. Default: true
javascript.suggest.objectLiteralMethodSnippets.enabled
: Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace Default: true
typescript.suggest.objectLiteralMethodSnippets.enabled
: Enable/disable snippet completions for methods in object literals. Requires using TypeScript 4.7+ in the workspace Default: true
Most Configurations are the same as with VSCode. Install coc-json and try completion with tsserver
, typescript
or javascript
in your coc-settings.json
.
Added configurations by coc-tsserver:
tsserver.useLocalTsdk
only works when used as workspace folder configuration.tsserver.tsconfigPath
tsserver.enable
Removed configurations:
typescript.tsserver.useSeparateSyntaxServer
Use tsserver.useSyntaxServer
instead.typescript.enablePromptUseWorkspaceTsdk
No propmpts given.typescript.tsc.autoDetect
Used for task, no such feature.typescript.surveys.enabled
No such feature.Renamed configurations to use tsserver
as prefix:
typescript.tsdk
=> tsserver.tsdk
typescript.disableAutomaticTypeAcquisition
=> tsserver.disableAutomaticTypeAcquisition
typescript.npm
=> tsserver.npm
typescript.locale
=> tsserver.locale
typescript.tsserver.maxTsServerMemory
=> tsserver.maxTsServerMemory
typescript.tsserver.watchOptions
=> tsserver.watchOptions
typescript.tsserver.useSyntaxServer
=> tsserver.useSyntaxServer
typescript.tsserver.log
=> tsserver.log
typescript.tsserver.trace
=> tsserver.trace.server
typescript.tsserver.enableTracing
=> tsserver.enableTracing
typescript.tsserver.pluginPaths
=> tsserver.pluginPaths
typescript.reportStyleChecksAsWarnings
=> tsserver.reportStyleChecksAsWarnings
js/ts.implicitProjectConfig.checkJs
=> tsserver.implicitProjectConfig.checkJs
js/ts.implicitProjectConfig.experimentalDecorators
=> tsserver.implicitProjectConfig.experimentalDecorators
js/ts.implicitProjectConfig.module
=> tsserver.implicitProjectConfig.module
js/ts.implicitProjectConfig.target
=> tsserver.implicitProjectConfig.target
js/ts.implicitProjectConfig.strictNullChecks
=> tsserver.implicitProjectConfig.strictNullChecks
js/ts.implicitProjectConfig.strictFunctionTypes
=> tsserver.implicitProjectConfig.strictFunctionTypes
typescript.tsserver.experimental.enableProjectDiagnostics
=> tsserver.experimental.enableProjectDiagnostics
"tsserver.log": "verbose"
to your coc-settings.json
(opened by command :CocConfig
)"tsserver.trace.server": "verbose"
to your coc-settings.json
:CocRestart
CocCommand tsserver.openTsServerLog
CocCommand workspace.showOutput tsserver
If you find any issues, please create an issue.
Q: Automatic type acquisition not work.
A: configure tsserver.npm
to your global npm path or configure "tsserver.disableAutomaticTypeAcquisition": false
to disable automatic typings installation.
Q: The extension needs some time to work.
A: The initialize of tsserver requires some time, you can add g:coc_status
to your status line, see :h coc-status
. If your tsserver get slow, try exclude unnecessary files in your jsconfig.json/tsconfig.json, make sure typescript version > 4.9 and disable logging (disabled by default).
Q: Update import on file rename not work.
A: Make sure install watchman in your $PATH. Use command :CocCommand workspace.showOutput watchman
to check watchman output.
Q: Not work with buffer just created.
A: Tsserver treat buffer without a disk file belongs to implicit project, VSCode could work because VSCode create empty file first for buffer, save the buffer to disk to make tsserver work.
Q: Not work with my javascript project.
A: Configure jsconfig.json to make tsserver understand your code. Some features may still not work well, it's recommended to use typescript.
Q: Not work on WSL.
A: Copy you project files from mounted dirs to linux home otherwise tsserver may not work properly.
Author: Neoclide
Source Code: https://github.com/neoclide/coc-tsserver
License: MIT
1677566280
Learn Vim (the Smart Way) is a guide to learn the good parts of Vim.
There are many places to learn Vim: the vimtutor
is a great place to start and the help
manual has all the references you will ever need. However, the average user needs something more than vimtutor
and less than the help
manual. This guide attempts to bridge that gap by highlighting only the key features to learn the most useful parts of Vim in the least time possible.
This guide is written for both beginner and advanced Vimmers. It starts out with broad and simple concepts and ends with specific and advanced concepts. If you're an advanced user already, I would encourage you to read this guide from start to finish anyway, because you will learn something new!
Follow @learnvim for updates, Vim tips, etc.
This guide is and will always be free.
If you want to financially support this project, you can purchase this guide on Leanpub.
zh-CN
)es
)Author: iggredible
Source Code: https://github.com/iggredible/Learn-Vim
License: View license
1676368391
This article describes how to find and replace text in Vim / Vi.
Vim is the most popular command-line text editor. It comes preinstalled on macOS and most Linux distributions. Finding and replacing text in Vim is quick and easy.
In Vim, you can find and replace text using the :substitute
(:s
) command.
To run commands in Vim, you must be in normal mode, the default mode when starting the editor. To go back to normal mode from any other mode, just press the βEscβ key.
The general form of the substitute command is as follows:
:[range]s/{pattern}/{string}/[flags] [count]
The command searches each line in [range]
for a {pattern}
, and replaces it with a {string}
. [count]
is a positive integer that multiplies the command.
If no [range]
and [count]
are given, only the pattern found in the current line is replaced. The current line is the line where the cursor is placed.
For example, to search for the first occurrence of the string βfooβ in the current line and replace it with βbarβ, you would use:
:s/foo/bar/
To replace all occurrences of the search pattern in the current line, add the g
flag:
:s/foo/bar/g
If you want to search and replace the pattern in the entire file, use the percentage character %
as a range. This character indicates a range from the first to the last line of the file:
:%s/foo/bar/g
If the {string}
part is omitted, it is considered as an empty string, and the matched pattern is deleted. The following command deletes all instances of the string βfooβ in the current line:
:s/foo//g
Instead of the slash character (/
), you can use any other non-alphanumeric single-byte character except as a delimiter. This option is useful when you have the β/β character in the search pattern or the replacement string.
:s|foo|bar|
To confirm each substitution, use the c
flag:
:s/foo/bar/gc
replace with bar (y/n/a/q/l/^E/^Y)?
Press y
to replace the match or l
to replace the match and quit. Press n
to skip the match and q
or Esc
to quit substitution. The a
option substitutes the match and all remaining occurrences of the match. To scroll the screen down, use CTRL+Y
, and to scroll up, use CTRL+E
.
You can also use regular expressions as a search pattern. The command bellow replaces all lines starting with βfooβ with βVim is the bestβ:
:%s/^foo.*/Vim is the best/gc
The ^
(caret) symbol matches the beginning of a line and .*
matches any number of any characters.
By default, the search operation is case sensitive; searching for βFOOβ will not match βFooβ.
To ignore case for the search pattern, use the i
flag:
:s/Foo/bar/gi
Another way to force ignore case is to append \c
after the search pattern. For example, /Linux\c
performs ignore case search.
If you changed the default case setting and you want to perform case sensitive search, use the I
flag:
:s/foo/bar/gi
Uppercase \C
after the pattern also forces case match search.
When no range is specified the substitute command operates only in the current line.
The range can be either one line or a range between two lines. The line specifiers are separated with the ,
or ;
characters. The range can be specified using the absolute line number or special symbols.
For example, to substitute all occurrences of βfooβ to βbarβ in all lines starting from line 3 to line 10 you would use:
:3,10s/foo/bar/g
The range is inclusive, which means that the first and last lines are included in the range.
The dot .
character indicates the current line and $
- the dollar sign the last line. To substitute βfooβ in all lines starting from the current line to the last one:
:.,$s/foo/bar/
The line specifier can also be set using the β+β or β-β symbol,followed by a number that is added or subtracted from the preceding line number. If the number after the symbol is omitted, it defaults to 1.
For example to substitute each βfooβ with βbarβ starting from the current line and the four next lines, type:
:.,+4s/foo/bar/g
The substitute command looks for the pattern as a string, not a whole word. If, for example, you were searching for βgnuβ, the search find matches where βgnuβ is embedded in larger words, such as βcygnusβ or βmagnumβ.
To search for a whole word, type \<
to mark the beginning of a word, enter the search pattern, type \>
to mark the end of a word:
For example, to search for the word βfooβ you would use \<foo\>
:
:s/\<foo\>/bar/
Vim keeps track of all the commands you run in the current session. To browse the history for previous substitute commands, enter :s
and use the arrow up/down keys to find a previous substitute operation. To run the command, simply press Enter
. You can also edit the command before performing the operation.
Comment lines (add #
before the line) from 5 to 20:
:5,20s/^/#/
Uncomment lines from 5 to 20, revert the previous changes:
:5,20s/^#//
Replace all instances of βappleβ, βorangeβ, and βmangoβ with βfruitβ:
:%s/apple\|orange\|mango/fruit/g
Remove trailing whitespace at the end of each line:
:%s/\s\+$//e
Searching and replacing is a powerful feature of Vim, which allows you to make changes to your text quickly.
Feel free to leave a comment if you have any questions.
Original article source at: https://linuxize.com/
1675874286
Make your Vim a TypeScript IDE.
Tsuquyomi works as a client for TSServer (which is an editor service bundled into TypeScript). So, installing Tsuquyomi, your vim gets the following features provided by TSServer:
Tsuquyomi does not provide syntax-highlight nor indentation. You can use the following Vim plugins for writing .ts:
.d.ts
management for dtsm users..d.ts
management for typings users.Tsuquyomi requires the following:
npm -g install typescript
Download zip.file from here, or use your favorite Vim plugin manager.
See https://github.com/tpope/vim-pathogen for instructions to install pathogen itself (very simple one-line install, one-line config)
# create bundle folder if it doesn't exist
mkdir -p ~/.vim/bundle
# Install and compile procvim.vim
git clone https://github.com/Shougo/vimproc.vim.git ~/.vim/bundle/vimproc.vim
pushd ~/.vim/bundle/vimproc.vim
make
popd
# Install tsuquyomi
git clone https://github.com/Quramy/tsuquyomi.git ~/.vim/bundle/tsuquyomi
If you use NeoBundle for Vim plugin management, append the following to your .vimrc
:
NeoBundle 'Shougo/vimproc.vim', {
\ 'build' : {
\ 'windows' : 'tools\\update-dll-mingw',
\ 'cygwin' : 'make -f make_cygwin.mak',
\ 'mac' : 'make -f make_mac.mak',
\ 'linux' : 'make',
\ 'unix' : 'gmake',
\ },
\ }
NeoBundle 'Quramy/tsuquyomi'
And exec :NeoBundleInstall
.
(About vimproc installation, please see the original install guide.)
Tsuquyomi supports Omni-Completion.
By the default, type <C-x> <C-o>
in insert mode, Tsuquyomi shows completions.
You can configure completion with the completeopt
option.
If you don't want the popup menu:
autocmd FileType typescript setlocal completeopt-=menu
If you want to show a method's signature in the popup menu, set g:tsuquyomi_completion_detail
. Remarks: This option makes completion slow
let g:tsuquyomi_completion_detail = 1
If you want to show a method's signature in the preview window when you complete this method's arguments (default):
(The preview window isn't shown when completion properties or variables)
autocmd FileType typescript setlocal completeopt+=menu,preview
Type <C-]>
in normal mode or visual mode, Tsuquyomi navigates to the location where the symbol under the cursor is defined.
Alternatively, call the Ex command :TsuquyomiDefinition
or :TsuDefinition
. (All Tsuquyomi's commands have aliases with short prefix 'Tsu'
.)
And type <C-t>
, Tsuquyomi moves the cursor to the location where the last <C-]>
was typed.
:TsuTypeDefinition
command is similar to :TsuDefinition
. :TsuTypeDefinition
navigates to the location where the type of the symbol under the cursor is defined.
Type <C-^>
in normal mode or visual mode, Tsuquyomi shows a list of location where the symbol under the cursor is referenced.
Alternatively, call the Ex command :TsuReferences
.
If you want where an interface is implemented, use :TsuImplementation
.
Call the Ex command :TsuSearch {keyword}
to get the list of locations which contain the keyword. This command searches the keyword from opened or referenced files in your project.
The search term minimum length can be configured with let g:tsuquyomi_search_term_min_length = 3
.
If you do not want to use the above key mappings please add let g:tsuquyomi_disable_default_mappings = 1
to your .vimrc
file.
When a buffer is saved, Tsuquyomi checks syntax and semantics. Alternatively call the Ex command :TsuGeterr
. And if it contains errors, Tsuquyomi shows them to Vim quickfix window.
If your use TypeScript v1.6.0 or later, you can use :TsuGeterrProject
command. This command shows all compilation errors contained in your project to quickfix window.
If the cursor is on an error and TypeScript's LanguageService has a code fix for this error, call :TsuQuickFix
. The code fix will be applied.
Make tsconfig.json.
For example:
{
"compilerOptions": {
"noImplicitAny": true,
"target": "es5",
"module": "commonjs"
}
}
When you change tsconfig.json after opening *.ts
files, you should exec :TsuquyomiReloadProject
command. So, the changes of tsconfig.json are reflected in the TSServer.
If you use syntastic, you can use syntastic for displaying syntax and semantics errors instead of vim's default quickfix window. To integrate syntastic, write the following setting to your .vimrc.
let g:tsuquyomi_disable_quickfix = 1
let g:syntastic_typescript_checkers = ['tsuquyomi'] " You shouldn't use 'tsc' checker.
syntastic has default TypeScript checker whose name is 'tsc'. You shouldn't use it with running Tusuquyomi because they don't share compile options. Tusuquyomi's checker whose name is 'tsuquyomi' uses tsserver and your tsconfig.json.
Using the command :TsuRenameSymbol
, you can rename the identifier under the cursor to a new name.
If you want to rename identifiers including in comments, you can use :TsuRenameSymbolC
command. For example, this command is useful when you want rename opt
in the following code:
/**
*
* @param opt
*
**/
var someFunc = (opt: any) => {...};
This feature does not have the default key mapping. If you need, configure your .vimrc
. For example:
autocmd FileType typescript nmap <buffer> <Leader>e <Plug>(TsuquyomiRenameSymbol)
autocmd FileType typescript nmap <buffer> <Leader>E <Plug>(TsuquyomiRenameSymbolC)
Tsuquyomi can display tooltip window about symbol under the mouse cursor. If you want to use this feature, configure .vimrc
as follows:
set ballooneval
autocmd FileType typescript setlocal balloonexpr=tsuquyomi#balloonexpr()
The ballonexpr
option is not available in terminal Vim. So, Tsuquyomi also provides a tooltip function tsuquyomi#hint()
.
For example:
autocmd FileType typescript nmap <buffer> <Leader>t : <C-u>echo tsuquyomi#hint()<CR>
The above example works in terminal Vim.
Tsuquyomi provides some unite sources.
Execute the following command, your project information is displayed.
:Unite tsproject
The project information contains:
This feature requires TypeScript@1.6.0 or later.
This feature requires Vim plugins:
If you have installed these plugins, calling the following Ex command, the outline of the current buffer is displayed.
:Unite outline
By the default, Tsuquyomi searches locally installed TypeScript. If not hit, Tsuquyomi uses TypeScript installed globally.
And execute the following command, you can confirm the path of tsserver:
:echo tsuquyomi#config#tsscmd()
It's highly experimental
For example, if your buffer is the following state:
readFile('hoge', 'utf-8', (err, content) => {
if(!err) console.log(content);
});
Move cursor onto readFile
and call :TsuImport
, so Tsuquyomi appends the import declaration.
import { readFile } from 'fs';
readFile('hoge', 'utf-8', (err, content) => {
if(!err) console.log(content);
});
To allow Tsuquyomi to import the shortest path instead of the complete one (where the initial module declaration is) one, put this in your .vimrc:
let g:tsuquyomi_shortest_import_path = 1
For example, if your project has the following 2 files, the plugin will use: import { foo } from './lib';
instead of: import { foo } from './lib/foo';
.
/* lib/index.ts */
export * from './foo';
/* lib/foo.ts */
export const foo = 'FOO'
If you want more details, please see doc.
Prepare test
cd test/
yarn install
cd ..
Run test cases
# Run all test cases with all supported TypeScript version
./runtest-all-ts.sh
# Run all test cases with the latest TypeScript version
./runtest.sh
# Run all test cases with the specified TypeScript version
VERSION=2.3 ./runtest.sh
# Run a test file
./run-one-test.sh test/path/to/test.spec.vim
# Run a test file with the specified TypeScript version
VERSION=2.3 ./run-one-test.sh
Author: Quramy
Source Code: https://github.com/Quramy/tsuquyomi
License: MIT
1675426637
An open source productivity tool drawing inspiration from workflowy and vim
NOTE: I don't have time to maintain this anymore, sorry!
This is a productivity tool which draws some inspiration from workflowy and vim.
Vimflowy was designed to work with multiple storage backends.
By default, you own your own data, as it is stored locally on your computer. However, you can let Google host it for you, or host it yourself.
See the deployment documentation for details. You can deploy with docker, or build from source yourself.
Contributions are very welcome! See dev_setup.md to see how to get started with a development setup.
Author: WuTheFWasThat
Source Code: https://github.com/WuTheFWasThat/vimflowy
License: MIT license
1675075462
Syntax and indent files for Swift
If you don't have a preferred installation method check out vim-plug.
swift.vim can show errors inline from swift package manager or from swiftlint using syntastic.
Install syntastic
swiftpm integration will be automatically enabled if you're running vim from a directory containing a Package.swift
file.
SwiftLint integration will be automatically enabled if you have SwiftLint installed and if you're running vim from a directory containing a .swiftlint.yml
file.
To enable both at once add this to your vimrc:
let g:syntastic_swift_checkers = ['swiftpm', 'swiftlint']
Author: Keith
Source Code: https://github.com/keith/swift.vim
License: MIT license
1674119060
Syntax file and other settings for TypeScript. The syntax file is taken from this blog post.
Checkout Tsuquyomi for omni-completion and other features for TypeScript editing.
From Vim 8 onward, the plugin can be installed as simply as (Unix/Mac):
git clone https://github.com/leafgarland/typescript-vim.git ~/.vim/pack/typescript/start/typescript-vim
On Windows/Powershell, use the following:
git clone https://github.com/leafgarland/typescript-vim.git $home/vimfiles/pack/typescript/start/typescript-vim
For older versions of Vim, the simplest way to install is via a Vim add-in manager such as Plug, Vundle or Pathogen.
See the Installation Wiki
git clone https://github.com/leafgarland/typescript-vim.git ~/.vim/bundle/typescript-vim
If you want to install manually then you need to copy the files from this repository into your vim path, see the vim docs for :help runtimepath for more information. This might be as simple as copying the files and directories to ~/.vim/
but it depends on your Vim install and operating system.
Once the files are installed the syntax highlighting and other settings will be automatically enabled anytime you edit a .ts
file.
This plugin includes a custom indenter (based on pangloss/vim-javascript's indenter), it works pretty well but there are cases where it fails. If these bother you or want to use other indent settings you can disable it by setting a flag in your .vimrc
:
let g:typescript_indent_disable = 1
If you want the indenter to automatically indent chained method calls as you type.
something
.foo()
.bar();
Then add something like setlocal indentkeys+=0.
to your .vimrc
, see :help 'indentkeys'
in vim for more information.
If you use the =
operator to re-indent code it will always indent chained method calls - this can be disabled by changing the regex the indent script uses to identify indented lines. In this case removing '.' from the regex means that it wont indent lines starting with '.'. Note, this is not ideal as the regex may change making your setting out of date.
let g:typescript_opfirst='\%([<>=,?^%|*/&]\|\([-:+]\)\1\@!\|!=\|in\%(stanceof\)\=\>\)'
This plugin contains compiler settings to set makeprg
and errorformat
. The compiler settings enable you to call the tsc
compiler directly from Vim and display any errors or warnings in Vim's QuickFix window.
To run the compiler, enter :make
, this will run tsc
against the last saved version of your currently edited file.
The default for makeprg
is tsc $* %
. You can enter other compiler options into your :make
command line and they will be inserted in place of $*
.
There are options to change the compiler name and to insert default options.
let g:typescript_compiler_binary = 'tsc'
let g:typescript_compiler_options = ''
These options will be passed to the binary as command arguments. For example, if g:typescript_compiler_binary = 'tsc'
and g:typescript_compiler_options = '--lib es6'
, l:makeprg
will be: tsc --lib es6 $* %
.
You can completely override this plugin's compiler settings with something like this in your .vimrc
, where you can set makeprg to whatever you want.
autocmd FileType typescript :set makeprg=tsc
Note, this plugin's compiler settings are not used by Syntastic which has its own way of changing the options. See https://github.com/scrooloose/syntastic#faqargs.
You can use something like this in your .vimrc
to make the QuickFix window automatically appear if :make
has any errors.
autocmd QuickFixCmdPost [^l]* nested cwindow
autocmd QuickFixCmdPost l* nested lwindow
Syntax highlighting for TypeScript can be customized by following variables.
g:typescript_ignore_typescriptdoc
: When this variable is defined, doccomments will not be highlighted.g:typescript_ignore_browserwords
: When this variable is set to 1
, browser API names such as window
or document
will not be highlighted. (default to 0
)Author: leafgarland
Source Code: https://github.com/leafgarland/typescript-vim
1673921040
A Kakoune / Neovim inspired editor, written in Rust.
The editing model is very heavily based on Kakoune; during development I found myself agreeing with most of Kakoune's design decisions.
Features
It's a terminal-based editor first, but I'd like to explore a custom renderer (similar to Emacs) in wgpu or skulpin.
Note: Only certain languages have indentation definitions at the moment. Check runtime/queries/<lang>/
for indents.scm
.
Installation
Packages are available for various distributions (see Installation docs).
If you would like to build from source:
git clone https://github.com/helix-editor/helix
cd helix
cargo install --locked --path helix-term
This will install the hx
binary to $HOME/.cargo/bin
and build tree-sitter grammars in ./runtime/grammars
.
Helix needs its runtime files so make sure to copy/symlink the runtime/
directory into the config directory (for example ~/.config/helix/runtime
on Linux/macOS, or %AppData%/helix/runtime
on Windows).
OS | Command |
---|---|
Windows (Cmd) | xcopy /e /i runtime %AppData%\helix\runtime |
Windows (PowerShell) | xcopy /e /i runtime $Env:AppData\helix\runtime |
Linux / macOS | ln -s $PWD/runtime ~/.config/helix/runtime |
Starting with Windows Vista you can also create symbolic links on Windows. Note that this requires elevated privileges - i.e. PowerShell or Cmd must be run as administrator.
PowerShell:
New-Item -ItemType SymbolicLink -Target "runtime" -Path "$Env:AppData\helix\runtime"
Cmd:
cd %appdata%\helix
mklink /D runtime "<helix-repo>\runtime"
The runtime location can be overridden via the HELIX_RUNTIME
environment variable.
NOTE: if
HELIX_RUNTIME
is set prior to callingcargo install --locked --path helix-term
, tree-sitter grammars will be built in$HELIX_RUNTIME/grammars
.
If you plan on keeping the repo locally, an alternative to copying/symlinking runtime files is to set HELIX_RUNTIME=/path/to/helix/runtime
(HELIX_RUNTIME=$PWD/runtime
if you're in the helix repo directory).
Packages already solve this for you by wrapping the hx
binary with a wrapper that sets the variable to the install dir.
NOTE: running via cargo also doesn't require setting explicit
HELIX_RUNTIME
path, it will automatically detect theruntime
directory in the project root.
If you want to customize your languages.toml
config, tree-sitter grammars may be manually fetched and built with hx --grammar fetch
and hx --grammar build
.
In order to use LSP features like auto-complete, you will need to install the appropriate Language Server for a language.
If installing from source, to use Helix in desktop environments that supports XDG desktop menu, including Gnome and KDE, copy the provided .desktop
file to the correct folder:
cp contrib/Helix.desktop ~/.local/share/applications
cp contrib/helix.png ~/.local/share/icons
To use another terminal than the default, you will need to modify the .desktop
file. For example, to use kitty
:
sed -i "s|Exec=hx %F|Exec=kitty hx %F|g" ~/.local/share/applications/Helix.desktop
sed -i "s|Terminal=true|Terminal=false|g" ~/.local/share/applications/Helix.desktop
Helix can be installed on macOS through homebrew:
brew install helix
Contributing
Contributing guidelines can be found here.
Getting help
Your question might already be answered on the FAQ.
Discuss the project on the community Matrix Space (make sure to join #helix-editor:matrix.org
if you're on a client that doesn't support Matrix Spaces yet).
Credits
Thanks to @JakeHL for designing the logo!
For more information, see the website or documentation.
All shortcuts/keymaps can be found in the documentation on the website.
Author: Helix-editor
Source Code: https://github.com/helix-editor/helix
License: MPL-2.0 license
1673456700
This is a vim syntax plugin for Ansible 2.x, it supports YAML playbooks, Jinja2 templates, and Ansible's hosts
files.
group_vars
or host_vars
foldertasks
, roles
, or handlers
folder and have either a .yml or .yaml suffixplaybook.y(a)ml
, site.y(a)ml
, or main.y(a)ml
hosts
will be treated as Ansible hosts filesYou can also set the filetype to yaml.ansible
, *.jinja2
, or ansible_hosts
if auto-detection does not work (e.g. :set ft=yaml.ansible
or :set ft=ruby.jinja2
). Note: If you want to detect a custom pattern of your own, you can easily add this in your .vimrc
using something like this:
au BufRead,BufNewFile */playbooks/*.yml set filetype=yaml.ansible
If you want to override the default file type detection you can easily do this in your .vimrc
. For example if you use YAML syntax for hosts
include something like this:
augroup ansible_vim_fthosts
autocmd!
autocmd BufNewFile,BufRead hosts setfiletype yaml.ansible
augroup END
This plugin should be quite reliable, as it sources the original formats and simply modifies the highlights as appropriate. This also enables a focus on simplicity and configurability instead of patching bad syntax detection.
examples (with solarized colorscheme)
Bright (and selective highlight) | Dim |
---|---|
![]() | ![]() |
installation
Use your favorite plugin manager, or try vim-plug if you're looking for a really nice one!
vim-plug: Plug 'pearofducks/ansible-vim'
vim-plug with post-update hook: Plug 'pearofducks/ansible-vim', { 'do': './UltiSnips/generate.sh' }
Note: Because of Ansible API changes, generate.sh
may require the latest (or near-latest) version of Ansible.
Note2: generate.sh
can receive some parameters, for more info see its Readme
vundle: Plugin 'pearofducks/ansible-vim'
pathogen: git clone https://github.com/pearofducks/ansible-vim ~/.vim/bundle/ansible-vim
Arch Linux: Package vim-ansible is available in the community repository.
Fedora: The vim-ansible package is available in the default repository.
RHEL/CentOS: The vim-ansible package is available in the EPEL repository.
g:ansible_unindent_after_newline
let g:ansible_unindent_after_newline = 1
When this variable is set, indentation will completely reset (unindent to column 0) after two newlines in insert-mode. The normal behavior of YAML is to always keep the previous indentation, even across multiple newlines with no content.
g:ansible_yamlKeyName
let g:ansible_yamlKeyName = 'yamlKey'
This option exists to provide additional compatibility with stephpy/vim-yaml.
g:ansible_attribute_highlight
let g:ansible_attribute_highlight = "ob"
Ansible modules use a key=value
format for specifying module-attributes in playbooks. This highlights those as specified. This highlight option is also used when highlighting key/value pairs in hosts
files.
Available flags (bold are defaults):
key=
key=
found on newlineskey=
foundkey=
foundg:ansible_name_highlight
let g:ansible_name_highlight = 'd'
Ansible modules commonly start with a name:
key for self-documentation of playbooks. This option enables/changes highlight of this.
Available flags (this feature is off by default):
name:
foundname:
foundg:ansible_extra_keywords_highlight
let g:ansible_extra_keywords_highlight = 1
Note: This option is enabled when set, and disabled when not set.
Highlight the following additional keywords: become become_exe become_flags become_method become_user become_pass prompt_l10n debugger always_run check_mode diff no_log args tags force_handlers vars vars_files vars_prompt delegate_facts delegate_to any_errors_fatal ignore_errors ignore_unreachable max_fail_percentage connection hosts port remote_user module_defaults environment fact_path gather_facts gather_subset gather_timeout async poll throttle timeout order run_once serial strategy
.
By default we only highlight: include include_role include_tasks include_vars import_role import_playbook import_tasks when changed_when failed_when block rescue always notify listen register action local_action post_tasks pre_tasks tasks handlers roles collections
and loop keywords with_.+
, loop
, loop_control
, until
, retries
, delay
.
g:ansible_extra_keywords_highlight_group
let g:ansible_extra_keywords_highlight_group = 'Statement'
Accepts any syntax group name from :help E669
- e.g. Comment, Constant, Identifier
Note: Defaults to 'Structure' when not set.
g:ansible_normal_keywords_highlight
let g:ansible_normal_keywords_highlight = 'Constant'
Accepts any syntax group name from :help E669
- e.g. Comment, Constant, Identifier
Note: Defaults to 'Statement' when not set.
This option change the highlight of the following common keywords: include include_role include_tasks include_vars import_role import_playbook import_tasks when changed_when failed_when block rescue always notify listen register action local_action post_tasks pre_tasks tasks handlers roles collections
.
g:ansible_loop_keywords_highlight
let g:ansible_loop_keywords_highlight = 'Constant'
Accepts any syntax group-name from :help E669
- e.g. Comment, Constant, Identifier
Note: Defaults to 'Statement' when not set.
This option changes the highlight of all with_.+
, loop
, loop_control
, until
, retries
and delay
keywords.
g:ansible_template_syntaxes
let g:ansible_template_syntaxes = { '*.rb.j2': 'ruby' }
Accepts a dictionary in the form of 'regex-for-file': 'filetype'
.
jinja2
will be automatically appendedAll files ending in *.j2
that aren't matched will simply get the jinja2
filetype.
g:ansible_ftdetect_filename_regex
let g:ansible_ftdetect_filename_regex = '\v(playbook|site|main|local|requirements)\.ya?ml$'
Accepts a regex string that is used to match the filename to determine if the file should use the Ansible filetype
Can be used to avoid clashes with other files that are named the same - e.g. main.yaml used in github workflows by removing main
from the regex
This behavior is not supported out of the box, but you can use this snippet in your vimrc.
You'll then be able to go to a role's definition with <leader>gr
.
bugs
It's unlikely that there will be bugs in highlighting that don't exist in the core format. Where appropriate these will be fixed in this plugin, but if the problem is with the original syntax we should probably focus on fixing that instead.
Indenting a full document - e.g with gg=G
- will not be supported and is not a goal of this plugin (unless someone else develops it!). Please do not file a bug report on this.
suggestions/requests
Suggestions for improvements are welcome, pull-requests with completed features even more so. :)
Author: Pearofducks
Source Code: https://github.com/pearofducks/ansible-vim
License: MIT license
1673428588
Cheat-Sheet Collection for DevOps, Engineers, IT and more
Nginx is open source software for web serving, reverse proxying, caching, load balancing, media streaming, and more.
Docker is a tool designed to make it easier to create, deploy, and run applications by using containers.
Ansible is the simplest way to automate apps and IT infrastructure.
Python is an interpreted, high-level, general-purpose programming language.
Go also known as Golang, is a statically typed, compiled programming language designed at Google.
Git is the open source distributed version control system that facilitates GitHub activities on your laptop or desktop.
Regular expression also known as Regex is a special text string for describing a search pattern.
PowerShell is a task automation and configuration management framework from Microsoft.
VIM aka Vi IMproved
is a highly configurable text editor for efficiently creating and changing any kind of text.
Jenkins an open source automation server which enables developers around the world to reliably build, test, and deploy their software.
CI/CD Continuous Integration and Continuous Delivery (CI/CD) have made the practice of software development increasingly complexβand overwhelming.
Kubernetes is an open-source system for automating deployment, scaling, and management of containerized applications.
Linux
Redis is an in-memory data structure store, used as a database, cache and message broker.
Slack is a messaging tool for making communication fast and easy. It lets you share messages and files with your team, organized by channel.
Puppet lets you automate the enforcement, security, and delivery of your hybrid or cloud-native infrastructure.
Google Cloud Developer builds scalable and highly available applications using Google recommended practices and tools that leverage fully managed services.
AI, Neural Networks, Machine Learning, Deep Learning & Data Science is intelligence demonstrated by machines.
PostgreSQL is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance.
Ajax AJAX = Asynchronous JavaScript And XML.
Amazon Web Services (AWS) is a subsidiary of Amazon providing on-demand cloud computing platforms and APIs to individuals, companies, and governments, on a metered pay-as-you-go basis.
Infrastructure as code (IaC), is the process of managing and provisioning computer data centers through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools.
Author: sk3pp3r
Source Code: https://github.com/sk3pp3r/cheat-sheet-pdf
License: MIT license
1673270520
I do NOT recommend installing all of my setup without looking through what is happening and customizing it for yourself. Fork this repo and update anything you like.
Look through the shell scripts in setup
folder to see what programs are being installed. You can add or remove everything from there. Most likely, if you are not a VIM power user you will want to modify some of the shell and atom plugins/config to suit yours preferences.
Install Homebrew and git, and set up SSH for Github
curl --remote-name https://raw.githubusercontent.com/colbycheeze/dotfiles/master/setup/pre-setup.sh
chmod a+x pre-setup.sh
./pre-setup.sh
Manually Install latest (non beta) Xcode from the app store
git clone git@github.com:colbycheeze/dotfiles.git ~/dotfiles && cd ~/dotfiles/setup && git checkout amazon && chmod a+x applications.sh && chmod a+x finishSetup.sh ./applications.sh
tmux
and install plugins: CTRL + A, I
nvim
and run :PlugInstall
and :UpdateRemotePlugins
Author: Colbycheeze
Source Code: https://github.com/colbycheeze/dotfiles
License: View license
1673055535
dart-vim-plugin provides filetype detection, syntax highlighting, and indentation for Dart code in Vim.
Looking for auto-complete, diagnostics as you type, jump to definition and other intellisense features? Try a vim plugin for the Language Server Protocol such as vim-lsc configured to start the Dart analysis server with the --lsp
flag.
Looking for an IDE experience? See the Dart Tools page.
Install as a typical vim plugin using your favorite approach. If you don't have a preference vim-plug is a good place to start. Below are examples for common choices, be sure to read the docs for each option.
call plug#begin()
"... <snip other plugins>
Plug 'dart-lang/dart-vim-plugin'
call plug#end()
Then invoke :PlugInstall
to install the plugin.
Clone the repository into your pathogen directory.
mkdir -p ~/.vim/bundle && cd ~/.vim/bundle && \
git clone https://github.com/dart-lang/dart-vim-plugin
Ensure your .vimrc
contains the line execute pathogen#infect()
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
"... <snip other plugins>
Plugin 'dart-lang/dart-vim-plugin'
call vundle#end()
Enable HTML syntax highlighting inside Dart strings with let dart_html_in_string=v:true
(default false).
Highlighting for specific syntax groups can be disabled by defining custom highlight group links. See :help dart-syntax
Enable Dart style guide syntax (like 2-space indentation) with let g:dart_style_guide = 2
Enable DartFmt execution on buffer save with let g:dart_format_on_save = 1
Configure DartFmt options with let g:dartfmt_options
(discover formatter options with dartfmt -h
)
dart format
?The indentation capabilities within vim are limited and it's not easy to fully express the indentation behavior of dart format
. The major area where this plugin differs from dart format
is indentation of function arguments when using a trailing comma in the argument list. When using a trailing comma (as is common in flutter widget code) dart format
uses 2 space indent for argument parameters. In all other indentation following an open parenthesis (argument lists without a trailing comma, multi-line assert statements, etc) dart format
uses 4 space indent. This plugin uses 4 space indent indent by default. To use 2 space indent by default, let g:dart_trailing_comma_indent = v:true
.
The Dart SDK comes with an analysis server that can be run in LSP mode. The server ships with the SDK. Assuming the bin
directory of the SDK is at $DART_SDK
the full command to run the analysis server in LSP mode is $DART_SDK/dart $DART_SDK/snapshots/analysis_server.dart.snapshot --lsp
. If you'll be opening files outside of the rootUri
sent by your LSP client (usually cwd
) you may want to pass onlyAnalyzeProjectsWithOpenFiles: true
in the initializationOptions
. See the documentation for your LSP client for how to configure initialization options. If you are using the vim-lsc plugin there is an additional plugin which can configure everything for you at vim-lsc-dart. A minimal config for a good default experience using vim-plug would look like:
call plug#begin()
Plug 'dart-lang/dart-vim-plugin'
Plug 'natebosch/vim-lsc'
Plug 'natebosch/vim-lsc-dart'
call plug#end()
let g:lsc_auto_map = v:true
Author: dart-lang
Source code: https://github.com/dart-lang/dart-vim-plugin
License: BSD-3-Clause license