Using F# in Sublime Text on Linux Mint
June 5, 2015I’ve been learning about functional programming for quite some time now, trying to wrap my head around the various concepts that this paradigm has to offer. One of the languages that spiked my interest besides Clojure is F#.
The reason for this is quite obvious. As a software developer who uses the .NET framework on a daily basis, I regularly run into the limitations of C#. Embracing a powerful functional language that targets the CLR and mitigates most of these limitations definitely looks quite appealing.
My goal has been to limit my use of Visual Studio to the absolute bare minimum. Especially during my spare time where I develop all my hobby projects on Linux Mint. I’m currently dabbling with F# using my preferred editor, Sublime Text.
Setting up F# on Linux Mint is quite easy. You just have to run the following commands:
$ sudo apt-get update
$ sudo apt-get install mono-complete
$ sudo apt-get install fsharp
This couldn’t be more easy. However, using F# in Sublime Text takes a bit more configuration.
First of all, you have to install the F# package which provides F# syntax highlighting for Sublime Text.
Secondly, in order to run F# code from Sublime Text it is recommended that you install the SublimeREPL package. Unfortunately, there is a minor issue with SublimeREPL what makes that the F# REPL doesn’t work in Sublime Text on Linux. In order to fix this issue you can just install SublimeREPL using Package Control and manually apply the changes from this pull request.
After installing these packages, you can add the following custom key bindings to the Key Bindings - User file in Sublime Text.
{
"keys": ["ctrl+alt+f"],
"command": "run_existing_window_command",
"args": {
"id": "repl_f#",
"file": "config/F/Main.sublime-menu"
}
},
{
"keys": ["ctrl+alt+r"],
"command": "repl_transfer_current",
"args": {
"scope": "selection"
}
}
Now when you open a new group in Sublime Text and press the CTRL-ALT-F key combination, you get the following layout:
Selecting the block of F# code in the left pane and pressing the CTRL-ALT-R key combination executes the code in the REPL in the right pane. I personally find this very useful during my explorations of the F# language.
Until next time.
Update 01:
In response to this blog post, Guillermo López mentioned that he has been working on the FSharp package for SublimeText.
@JanVanRyswyck @dsyme This one adds autocompletion to F# in ST: https://t.co/FPICSZxo8W
— Guillermo López (@guillermoooo) June 8, 2015
This package brings autocompletion, live error checking and several other cool things to the table and can easily be installed using package control. Simply a must have when using F# in SublimeText.
If you and your team want to learn more about how to write maintainable unit tests and get the most out of TDD practices, make sure to have look at our trainings and workshops or check out the books section. Feel free to reach out at info. @ principal-it .be
Jan Van Ryswyck
Thank you for visiting my blog. I’m a professional software developer since Y2K. A blogger since Y2K+5. Provider of training and coaching in XP practices. Curator of the Awesome Talks list. Past organizer of the European Virtual ALT.NET meetings. Thinking and learning about all kinds of technologies since forever.
Comments
Writing Maintainable
Unit Tests
Watch The Videos
Latest articles
-
Contract Tests - Parameterised Test Cases
June 28, 2023
-
Contract Tests - Abstract Test Cases
April 12, 2023
-
Contract Tests
February 1, 2023
-
The Testing Quadrant
June 15, 2022
-
Tales Of TDD: The Big Refactoring
February 2, 2022
Tags
- .NET
- ALT.NET
- ASP.NET
- Agile
- Announcement
- Architecture
- Behavior-Driven Development
- C++
- CQRS
- Clojure
- CoffeeScript
- Community
- Concurrent Programming
- Conferences
- Continuous Integration
- Core Skills
- CouchDB
- Database
- Design Patterns
- Domain-Driven Design
- Event Sourcing
- F#
- Fluent Interfaces
- Functional Programming
- Hacking
- Humor
- Java
- JavaScript
- Linux
- Microsoft
- NHibernate
- NoSQL
- Node.js
- Object-Relational Mapping
- Open Source
- Reading
- Ruby
- Software Design
- SourceControl
- Test-Driven Development
- Testing
- Tools
- Visual Studio
- Web
- Windows
Disclaimer
The opinions expressed on this blog are my own personal opinions. These do NOT represent anyone else’s view on the world in any way whatsoever.
About
Thank you for visiting my website. I’m a professional software developer since Y2K. A blogger since Y2K+5. Author of Writing Maintainable Unit Tests. Provider of training and coaching in XP practices. Curator of the Awesome Talks list. Thinking and learning about all kinds of technologies since forever.
Latest articles
Contract Tests - Parameterised Test Cases
Contract Tests - Abstract Test Cases
Contract Tests
The Testing Quadrant
Contact information
(+32) 496 38 00 82
info @ principal-it .be