Skip to content

Instantly share code, notes, and snippets.

@tokoro10g
Created January 8, 2020 09:23
Show Gist options
  • Save tokoro10g/2462e67f6c6962a5d7f4eb9f988e7fd7 to your computer and use it in GitHub Desktop.
Save tokoro10g/2462e67f6c6962a5d7f4eb9f988e7fd7 to your computer and use it in GitHub Desktop.
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(when no-ssl
(warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
;;(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
(package-initialize)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(package-selected-packages (quote (company matlab-mode lsp-mode))))
(custom-set-faces
;; custom-set-faces was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
)
(autoload 'matlab-mode "matlab" "Matlab Editing Mode" t)
(add-to-list
'auto-mode-alist
'("\\.m$" . matlab-mode))
(setq matlab-indent-function t)
(setq matlab-shell-command "matlab")
(require 'lsp-mode)
(add-hook 'matlab-mode-hook #'lsp)
(use-package lsp-mode
:ensure t
:commands (lsp lsp-deferred)
:config
(setq lsp-log-io t)
(setq lsp-auto-configure t)
(lsp-register-client
(make-lsp-client :new-connection (lsp-stdio-connection "~/dev/matlab-langserver/matlab-langserver.sh")
:major-modes '(matlab-mode)
:server-id 'matlab-langserver)))
(require 'company)
(global-company-mode)
(setq company-idle-delay 0)
(setq company-minimum-prefix-length 2)
(setq company-selection-wrap-around t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment