cp2k-syntax
CP2K input file syntax highlighting for SublimeText 3
Details
Installs
- Total 434
- Win 258
- Mac 96
- Linux 80
Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | Feb 12 | Feb 11 | Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | Feb 5 | Feb 4 | Feb 3 | Feb 2 | Feb 1 | Jan 31 | Jan 30 | Jan 29 | Jan 28 | Jan 27 | Jan 26 | Jan 25 | Jan 24 | Jan 23 | Jan 22 | Jan 21 | Jan 20 | Jan 19 | Jan 18 | Jan 17 | Jan 16 | Jan 15 | Jan 14 | Jan 13 | Jan 12 | Jan 11 | Jan 10 | Jan 9 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
cp2k-syntax
Comprehensive syntax highlighting for CP2K input files in Sublime Text 3.
CP2K is a freely available program package to perform atomistic simulations of solid state, liquid, molecular, periodic, material, crystal, and biological systems.
Color scheme in the example figure is base16-railscasts
Features
- Syntax highlighting based on the
.sublime-syntax
format requiring a recent version of Sublime Text 3 (minimum build number 3084) - Standalone python linter which parses the input file and compares it to the XML input description of CP2K
- Snippets for commonly used control sequences
Installation
The simplest way to install this package is via Package Control. Alternatively, you can clone this repository.
Installation via Package Control
- Make sure you have a working python interpreter (supported versions
=>2.5
and3.x
). - If not already installed, install Package Control for Sublime Text 3.
- Install SublimeLinter.
- Install this package via Package Control
- Open the Command Palette (
ctrl+shift+p
on Linux/Windows) - Type
install
and selectPackage Control: Install Package
- Type
cp2k
and selectcp2k-syntax
- Open the Command Palette (
Installation via Git
- Make sure you have all the prerequisites listed above.
- Open a terminal and create a working directory for this repository.
- Move to the directory you created in the previous step and clone the repository
git clone https://github.com/nholmber/cp2k-syntax
- Create a folder for this package in your local Sublime Text
Packages/User
directory. - Recursively copy (
cp -r *
) all files related to this package into the folder you created in the previous step.
Usage and configuration
By default, files ending in .inp
, .inc
, and .restart
are recognized as CP2K input files and syntax highlighting should be applied to these files automatically. If for some reason the automatic detection does not work or you wish to enable highlighting for a different file extension, you need to take the following steps
- Open the file for which you wish to enable syntax highlighting.
- Navigate to
View -> Syntax -> Open all with current extension as ... -> CP2K Input
The output of the linter is parsed and displayed on screen by the SublimeLinter
package. To customize the linting view and other settings, please take a look at the documentation of SublimeLinter
.
The linter recognizes allowed keyword names by parsing the XML input description of CP2K. A sample XML file sample-xml/cp2k_input.xml
is provided for CP2K version 3.0
and the linter by default uses this file. If you are using a different version of CP2K, you can replace the default XML file with your own file by following these steps
- Create an XML input description for your version of CP2K.
- Place the generated
cp2k_input.xml
in any directory. - Configure the linter to use the generated file.
- Open the Command Palette (
ctrl+shift+p
on Linux/Windows) - Type
preferences sub
and selectPreferences: SublimeLinter Settings -- User
- Scroll down the settings until you find
cp2klint
settings (underlinters
). - Replace the default
manualfile
with your own XML file including a full path and filename for the file.
- Open the Command Palette (
Contributing
If you find bug in the linter or syntax highlighting, please open a new issue in the issue tracker and include a minimal input file for reproducing the bug. You can also contribute directly by forking the project and posting a pull request. Check the issue tracker for known issues and nice-to-have unimplemented features.